Struct CreateInvoiceLink

Source
pub struct CreateInvoiceLink {
Show 22 fields pub title: String, pub description: String, pub payload: String, pub currency: String, pub prices: Vec<LabeledPrice>, pub provider_token: Option<String>, pub business_connection_id: Option<BusinessConnectionId>, pub subscription_period: Option<Seconds>, pub max_tip_amount: Option<u32>, pub suggested_tip_amounts: Option<Vec<u32>>, pub provider_data: Option<String>, pub photo_url: Option<String>, pub photo_size: Option<String>, pub photo_width: Option<String>, pub photo_height: Option<String>, pub need_name: Option<bool>, pub need_phone_number: Option<bool>, pub need_email: Option<bool>, pub need_shipping_address: Option<bool>, pub send_phone_number_to_provider: Option<bool>, pub send_email_to_provider: Option<bool>, pub is_flexible: Option<bool>,
}
Expand description

Use this method to create a link for an invoice. Returns the created invoice link as String on success.

Fields§

§title: String

Product name, 1-32 characters

§description: String

Product description, 1-255 characters

§payload: String

Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.

§currency: String

Three-letter ISO 4217 currency code, see more on currencies. Pass XTR for payments in Telegram Stars.

§prices: Vec<LabeledPrice>

Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)

§provider_token: Option<String>

Payments provider token, obtained via Botfather. Pass None for payments in Telegram Stars.

§business_connection_id: Option<BusinessConnectionId>

Unique identifier of the business connection on behalf of which the link will be created. For payments in Telegram Stars only.

§subscription_period: Option<Seconds>

The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user.

§max_tip_amount: Option<u32>

The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0

§suggested_tip_amounts: Option<Vec<u32>>

A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.

§provider_data: Option<String>

A JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.

§photo_url: Option<String>

URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.

§photo_size: Option<String>

Photo size in bytes

§photo_width: Option<String>

Photo width

§photo_height: Option<String>

Photo height

§need_name: Option<bool>

Pass True, if you require the user’s full name to complete the order

§need_phone_number: Option<bool>

Pass True, if you require the user’s phone number to complete the order

§need_email: Option<bool>

Pass True, if you require the user’s email address to complete the order

§need_shipping_address: Option<bool>

Pass True, if you require the user’s shipping address to complete the order

§send_phone_number_to_provider: Option<bool>

Pass True, if user’s phone number should be sent to provider

§send_email_to_provider: Option<bool>

Pass True, if user’s email address should be sent to provider

§is_flexible: Option<bool>

Pass True, if the final price depends on the shipping method

Implementations§

Source

pub fn new( title: impl Into<String>, description: impl Into<String>, payload: impl Into<String>, currency: impl Into<String>, prices: impl IntoIterator<Item = LabeledPrice>, ) -> Self

Trait Implementations§

Source§

fn clone(&self) -> CreateInvoiceLink

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

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

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

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

fn eq(&self, other: &CreateInvoiceLink) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

const NAME: &'static str = "CreateInvoiceLink"

Name of a Telegram method. Read more
Source§

type Output = String

The return type of a Telegram method. Read more
Source§

fn timeout_hint(&self) -> Option<Duration>

If this payload may take long time to execute (e.g. GetUpdates with big timeout), the minimum timeout that should be used.
Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<P> CreateInvoiceLinkSetters for P
where P: HasPayload<Payload = CreateInvoiceLink>,

Source§

fn title<T>(self, value: T) -> Self
where T: Into<String>,

Setter for title field.
Source§

fn description<T>(self, value: T) -> Self
where T: Into<String>,

Setter for description field.
Source§

fn payload<T>(self, value: T) -> Self
where T: Into<String>,

Setter for payload field.
Source§

fn currency<T>(self, value: T) -> Self
where T: Into<String>,

Setter for currency field.
Source§

fn prices<T>(self, value: T) -> Self
where T: IntoIterator<Item = LabeledPrice>,

Setter for prices field.
Source§

fn provider_token<T>(self, value: T) -> Self
where T: Into<String>,

Setter for provider_token field.
Source§

fn business_connection_id(self, value: BusinessConnectionId) -> Self

Setter for business_connection_id field.
Source§

fn subscription_period(self, value: Seconds) -> Self

Setter for subscription_period field.
Source§

fn max_tip_amount(self, value: u32) -> Self

Setter for max_tip_amount field.
Source§

fn suggested_tip_amounts<T>(self, value: T) -> Self
where T: IntoIterator<Item = u32>,

Setter for suggested_tip_amounts field.
Source§

fn provider_data<T>(self, value: T) -> Self
where T: Into<String>,

Setter for provider_data field.
Source§

fn photo_url<T>(self, value: T) -> Self
where T: Into<String>,

Setter for photo_url field.
Source§

fn photo_size<T>(self, value: T) -> Self
where T: Into<String>,

Setter for photo_size field.
Source§

fn photo_width<T>(self, value: T) -> Self
where T: Into<String>,

Setter for photo_width field.
Source§

fn photo_height<T>(self, value: T) -> Self
where T: Into<String>,

Setter for photo_height field.
Source§

fn need_name(self, value: bool) -> Self

Setter for need_name field.
Source§

fn need_phone_number(self, value: bool) -> Self

Setter for need_phone_number field.
Source§

fn need_email(self, value: bool) -> Self

Setter for need_email field.
Source§

fn need_shipping_address(self, value: bool) -> Self

Setter for need_shipping_address field.
Source§

fn send_phone_number_to_provider(self, value: bool) -> Self

Source§

fn send_email_to_provider(self, value: bool) -> Self

Setter for send_email_to_provider field.
Source§

fn is_flexible(self, value: bool) -> Self

Setter for is_flexible field.
Source§

impl<T> Erasable for T

Source§

const ACK_1_1_0: bool = true

Whether this implementor has acknowledged the 1.1.0 update to unerase’s documented implementation requirements. Read more
Source§

unsafe fn unerase(this: NonNull<Erased>) -> NonNull<T>

Unerase this erased pointer. Read more
Source§

fn erase(this: NonNull<Self>) -> NonNull<Erased>

Turn this erasable pointer into an erased pointer. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<P> HasPayload for P
where P: Payload,

Source§

type Payload = P

The type of the payload contained.
Source§

fn payload_mut(&mut self) -> &mut <P as HasPayload>::Payload

Gain mutable access to the underlying payload.
Source§

fn payload_ref(&self) -> &<P as HasPayload>::Payload

Gain immutable access to the underlying payload.
Source§

fn with_payload_mut<F>(self, f: F) -> Self
where Self: Sized, F: FnOnce(&mut Self::Payload),

Update payload with a function
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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
Source§

impl<T> ErasedDestructor for T
where T: 'static,