CreateInvoiceParamsBuilder

Struct CreateInvoiceParamsBuilder 

Source
pub struct CreateInvoiceParamsBuilder<A = Missing, C = Missing, P = Missing, U = Missing> {
Show 14 fields pub currency_type: Option<CurrencyType>, pub asset: Option<CryptoCurrencyCode>, pub fiat: Option<FiatCurrencyCode>, pub accept_asset: Option<Vec<CryptoCurrencyCode>>, pub amount: Decimal, pub description: Option<String>, pub hidden_message: Option<String>, pub paid_btn_name: Option<PayButtonName>, pub paid_btn_url: Option<String>, pub swap_to: Option<SwapToAssets>, pub payload: Option<String>, pub allow_comments: Option<bool>, pub allow_anonymous: Option<bool>, pub expires_in: Option<u32>, /* private fields */
}

Fields§

§currency_type: Option<CurrencyType>§asset: Option<CryptoCurrencyCode>§fiat: Option<FiatCurrencyCode>§accept_asset: Option<Vec<CryptoCurrencyCode>>§amount: Decimal§description: Option<String>§hidden_message: Option<String>§paid_btn_name: Option<PayButtonName>§paid_btn_url: Option<String>§swap_to: Option<SwapToAssets>§payload: Option<String>§allow_comments: Option<bool>§allow_anonymous: Option<bool>§expires_in: Option<u32>

Implementations§

Source§

impl CreateInvoiceParamsBuilder<Missing, Missing, Missing, Missing>

Source

pub fn new() -> Self

Create a new CreateInvoiceParamsBuilder with default values.

Source§

impl<C, P, U> CreateInvoiceParamsBuilder<Missing, C, P, U>

Source

pub fn amount(self, amount: Decimal) -> CreateInvoiceParamsBuilder<Set, C, P, U>

Set the amount for the invoice.

Source§

impl<A, P, U> CreateInvoiceParamsBuilder<A, Missing, P, U>

Source

pub fn asset( self, asset: CryptoCurrencyCode, ) -> CreateInvoiceParamsBuilder<A, Set, P, U>

Set the asset for the invoice, if the currency type is crypto.

Source

pub fn fiat( self, fiat: FiatCurrencyCode, ) -> CreateInvoiceParamsBuilder<A, Set, P, U>

Set the fiat for the invoice, if the currency type is fiat.

Source§

impl<A, C, U> CreateInvoiceParamsBuilder<A, C, Missing, U>

Source

pub fn paid_btn_name( self, paid_btn_name: PayButtonName, ) -> CreateInvoiceParamsBuilder<A, C, Set, U>

Set the paid button name for the invoice. Optional. Label of the button which will be presented to a user after the invoice is paid. Supported names: viewItem – “View Item”, openChannel – “View Channel”, openBot – “Open Bot”, callback – “Return to the bot”

Source§

impl<A, C> CreateInvoiceParamsBuilder<A, C, Set, Missing>

Source

pub fn paid_btn_url( self, paid_btn_url: impl Into<String>, ) -> CreateInvoiceParamsBuilder<A, C, Set, Set>

Set the paid button URL for the invoice. Optional. Required if paid_btn_name is specified. URL opened using the button which will be presented to a user after the invoice is paid. You can set any callback link (for example, a success link or link to homepage). Starts with https or http.

Source§

impl<A, C, P, U> CreateInvoiceParamsBuilder<A, C, P, U>

Source

pub fn accept_asset(self, accept_asset: Vec<CryptoCurrencyCode>) -> Self

Set the accepted assets for the invoice. Optional. Defaults to all currencies.

Source

pub fn description(self, description: impl Into<String>) -> Self

Set the description for the invoice. Optional. Description for the invoice. User will see this description when they pay the invoice. Up to 1024 characters.

Source

pub fn hidden_message(self, hidden_message: impl Into<String>) -> Self

Set the hidden message for the invoice. Optional. Text of the message which will be presented to a user after the invoice is paid. Up to 2048 characters.

Source

pub fn payload(self, payload: impl Into<String>) -> Self

Set the payload for the invoice. Optional. Any data you want to attach to the invoice (for example, user ID, payment ID, ect). Up to 4kb.

Source

pub fn allow_comments(self, allow_comments: bool) -> Self

Set the allow comments for the invoice. Optional. Allow a user to add a comment to the payment. Defaults to true.

Source

pub fn allow_anonymous(self, allow_anonymous: bool) -> Self

Set the allow anonymous for the invoice. Optional. Allow a user to pay the invoice anonymously. Defaults to true.

Source

pub fn expires_in(self, expires_in: u32) -> Self

Set the expiration time for the invoice. Optional. You can set a payment time limit for the invoice in seconds. Values between 1-2678400 are accepted.

Source§

impl CreateInvoiceParamsBuilder<Set, Set, Missing, Missing>

Source

pub async fn build( self, client: &CryptoBot, ) -> CryptoBotResult<CreateInvoiceParams>

Source§

impl CreateInvoiceParamsBuilder<Set, Set, Set, Set>

Source

pub async fn build( self, client: &CryptoBot, ) -> CryptoBotResult<CreateInvoiceParams>

Trait Implementations§

Source§

impl<A: Debug, C: Debug, P: Debug, U: Debug> Debug for CreateInvoiceParamsBuilder<A, C, P, U>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CreateInvoiceParamsBuilder<Missing, Missing, Missing, Missing>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<A, C, P, U> Freeze for CreateInvoiceParamsBuilder<A, C, P, U>

§

impl<A, C, P, U> RefUnwindSafe for CreateInvoiceParamsBuilder<A, C, P, U>

§

impl<A, C, P, U> Send for CreateInvoiceParamsBuilder<A, C, P, U>
where A: Send, C: Send, P: Send, U: Send,

§

impl<A, C, P, U> Sync for CreateInvoiceParamsBuilder<A, C, P, U>
where A: Sync, C: Sync, P: Sync, U: Sync,

§

impl<A, C, P, U> Unpin for CreateInvoiceParamsBuilder<A, C, P, U>
where A: Unpin, C: Unpin, P: Unpin, U: Unpin,

§

impl<A, C, P, U> UnwindSafe for CreateInvoiceParamsBuilder<A, C, P, U>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more