PaymentBuilder

Struct PaymentBuilder 

Source
pub struct PaymentBuilder { /* private fields */ }
Expand description

Builder for Payment objects.

Implementations§

Source§

impl PaymentBuilder

Source

pub fn asset(self, asset: AssetId) -> Self

Set the asset for this payment

Source

pub fn amount(self, amount: String) -> Self

Set the amount for this payment

Source

pub fn currency_code(self, currency_code: String) -> Self

Set the currency code for this payment

Source

pub fn supported_assets(self, supported_assets: Vec<AssetId>) -> Self

Set the supported assets for this payment

Source

pub fn add_supported_asset(self, asset: AssetId) -> Self

Add a supported asset for this payment

Source

pub fn customer(self, customer: Party) -> Self

Set the customer for this payment

Source

pub fn merchant(self, merchant: Party) -> Self

Set the merchant for this payment

Source

pub fn transaction_id(self, transaction_id: String) -> Self

Set the transaction ID for this payment

Source

pub fn memo(self, memo: String) -> Self

Set the memo for this payment

Source

pub fn expiry(self, expiry: String) -> Self

Set the expiration time for this payment

Source

pub fn invoice(self, invoice: Invoice) -> Self

Set the invoice for this payment with an Invoice object

Source

pub fn invoice_url(self, url: String) -> Self

Set the invoice URL for this payment

Source

pub fn add_agent(self, agent: Agent) -> Self

Add an agent to this payment

Source

pub fn agents(self, agents: Vec<Agent>) -> Self

Set all agents for this payment

Source

pub fn add_metadata(self, key: String, value: Value) -> Self

Add a metadata field

Source

pub fn metadata(self, metadata: HashMap<String, Value>) -> Self

Set all metadata for this payment

Source

pub fn build(self) -> Payment

Build the Payment object

§Panics

Panics if required fields are not set

Trait Implementations§

Source§

impl Default for PaymentBuilder

Source§

fn default() -> PaymentBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V