pub struct InputMessageContentInvoice { /* private fields */ }Expand description
Represents an invoice message to be sent as the result of an inline query.
Implementations§
Source§impl InputMessageContentInvoice
impl InputMessageContentInvoice
Sourcepub fn new<A, B, C, D, E>(
currency: A,
description: B,
payload: C,
prices: D,
title: E,
) -> Selfwhere
A: Into<String>,
B: Into<String>,
C: Into<String>,
D: IntoIterator<Item = LabeledPrice>,
E: Into<String>,
pub fn new<A, B, C, D, E>(
currency: A,
description: B,
payload: C,
prices: D,
title: E,
) -> Selfwhere
A: Into<String>,
B: Into<String>,
C: Into<String>,
D: IntoIterator<Item = LabeledPrice>,
E: Into<String>,
Creates a new InputMessageContentInvoice.
§Arguments
currency- Three-letter ISO 4217 currency code.description- Product description; 1-255 characters.payload- Bot-defined invoice payload; 1-128 bytes; this will not be displayed to the user, use for your internal processes.prices- Price breakdown (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.).title- Product name; 1-32 characters.
Sourcepub fn with_is_flexible(self, value: bool) -> Self
pub fn with_is_flexible(self, value: bool) -> Self
Sets a new value for the is_flexible flag.
§Arguments
value- Indicates whether the final price depends on the shipping method.
Sourcepub fn with_max_tip_amount(self, value: Integer) -> Self
pub fn with_max_tip_amount(self, value: Integer) -> Self
Sets a new max tip amount.
§Arguments
value- Maximum accepted amount for tips in the smallest units of the currency; default - 0.
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).
Sourcepub fn with_need_email(self, value: bool) -> Self
pub fn with_need_email(self, value: bool) -> Self
Sets a new value for the need_email flag.
§Arguments
value- Indicates whether an email address of a user is required to complete the order.
Sourcepub fn with_need_name(self, value: bool) -> Self
pub fn with_need_name(self, value: bool) -> Self
Sets a new value for the need_name flag.
§Arguments
value- Indicates whether a full name of a user is required to complete the order.
Sourcepub fn with_need_phone_number(self, value: bool) -> Self
pub fn with_need_phone_number(self, value: bool) -> Self
Sets a new value for the need_phone_number flag.
§Arguments
value- Indicates whether a phone number of a user is required to complete the order.
Sourcepub fn with_need_shipping_address(self, value: bool) -> Self
pub fn with_need_shipping_address(self, value: bool) -> Self
Sets a new value for the need_shipping_address flag.
§Arguments
value- Indicates whether a shipping address of a user is required to complete the order.
Sourcepub fn with_photo_height(self, value: Integer) -> Self
pub fn with_photo_height(self, value: Integer) -> Self
Sourcepub fn with_photo_size(self, value: Integer) -> Self
pub fn with_photo_size(self, value: Integer) -> Self
Sourcepub fn with_photo_width(self, value: Integer) -> Self
pub fn with_photo_width(self, value: Integer) -> Self
Sourcepub fn with_photo_url<T>(self, value: T) -> Self
pub fn with_photo_url<T>(self, value: T) -> Self
Sets a new photo URL.
§Arguments
value- 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.
Sourcepub fn with_provider_data<T>(self, value: &T) -> Result<Self, JsonError>where
T: Serialize,
pub fn with_provider_data<T>(self, value: &T) -> Result<Self, JsonError>where
T: Serialize,
Sets a new provider data.
§Arguments
value- An object for data about the invoice, which will be shared with the payment provider.
A detailed description of the required fields should be provided by the payment provider.
Sourcepub fn with_provider_token<T>(self, value: T) -> Self
pub fn with_provider_token<T>(self, value: T) -> Self
Sets a new provider token.
§Arguments
value- Payment provider token, obtained via @BotFather; pass an empty string for payments in Telegram Stars.
Sourcepub fn with_send_email_to_provider(self, value: bool) -> Self
pub fn with_send_email_to_provider(self, value: bool) -> Self
Sets a new value for the send_email_to_provider flag.
§Arguments
value- Indicates whether an email address of a user should be sent to provider.
Sourcepub fn with_send_phone_number_to_provider(self, value: bool) -> Self
pub fn with_send_phone_number_to_provider(self, value: bool) -> Self
Sets a new value for the send_phone_number_to_provider flag.
§Arguments
value- Indicates whether a phone number of a user should be sent to provider.
Sourcepub fn with_suggested_tip_amounts<T>(self, value: T) -> Selfwhere
T: IntoIterator<Item = Integer>,
pub fn with_suggested_tip_amounts<T>(self, value: T) -> Selfwhere
T: IntoIterator<Item = Integer>,
Sets a new suggested tip amounts.
§Arguments
value- Array of suggested amounts of tip in the smallest units of the currency.
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.
Trait Implementations§
Source§impl Clone for InputMessageContentInvoice
impl Clone for InputMessageContentInvoice
Source§fn clone(&self) -> InputMessageContentInvoice
fn clone(&self) -> InputMessageContentInvoice
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more