Struct teloxide::types::InputMessageContentInvoice
source · pub struct InputMessageContentInvoice {Show 20 fields
pub title: String,
pub description: String,
pub payload: String,
pub provider_token: String,
pub currency: Currency,
pub prices: Vec<LabeledPrice, Global>,
pub max_tip_amount: Option<u32>,
pub suggested_tip_amounts: Option<Vec<u32, Global>>,
pub provider_data: Option<String>,
pub photo_url: Option<Url>,
pub photo_size: Option<u32>,
pub photo_width: Option<u32>,
pub photo_height: Option<u32>,
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
Represents the content of an invoice message to be sent as the result of an inline query.
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.
provider_token: String
Payment provider token, obtained via @Botfather
currency: Currency
Three-letter ISO 4217 currency code, see more on currencies
prices: Vec<LabeledPrice, Global>
Price breakdown, list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
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, Global>>
List of suggested amounts of tip 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 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.
photo_url: Option<Url>
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<u32>
Photo size
photo_width: Option<u32>
Photo width
photo_height: Option<u32>
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§impl InputMessageContentInvoice
impl InputMessageContentInvoice
pub fn new<T, D, PA, PT, PR>(
title: T,
description: D,
payload: PA,
provider_token: PT,
currency: Currency,
prices: PR
) -> InputMessageContentInvoicewhere
T: Into<String>,
D: Into<String>,
PA: Into<String>,
PT: Into<String>,
PR: IntoIterator<Item = LabeledPrice>,
pub fn title<T>(self, val: T) -> InputMessageContentInvoicewhere
T: Into<String>,
pub fn description<T>(self, val: T) -> InputMessageContentInvoicewhere
T: Into<String>,
pub fn payload<T>(self, val: T) -> InputMessageContentInvoicewhere
T: Into<String>,
pub fn provider_token<T>(self, val: T) -> InputMessageContentInvoicewhere
T: Into<String>,
pub fn currency(self, val: Currency) -> InputMessageContentInvoice
pub fn prices<T>(self, val: T) -> InputMessageContentInvoicewhere
T: IntoIterator<Item = LabeledPrice>,
pub fn max_tip_amount(self, val: u32) -> InputMessageContentInvoice
pub fn suggested_tip_amounts<T>(self, val: T) -> InputMessageContentInvoicewhere
T: IntoIterator<Item = u32>,
pub fn provider_data<T>(self, val: T) -> InputMessageContentInvoicewhere
T: Into<String>,
pub fn photo_url(self, val: Url) -> InputMessageContentInvoice
pub fn photo_size(self, val: u32) -> InputMessageContentInvoice
pub fn photo_width(self, val: u32) -> InputMessageContentInvoice
pub fn photo_height(self, val: u32) -> InputMessageContentInvoice
pub fn need_name(self, val: bool) -> InputMessageContentInvoice
pub fn need_phone_number(self, val: bool) -> InputMessageContentInvoice
pub fn need_email(self, val: bool) -> InputMessageContentInvoice
pub fn need_shipping_address(self, val: bool) -> InputMessageContentInvoice
pub fn send_phone_number_to_provider(
self,
val: bool
) -> InputMessageContentInvoice
pub fn send_email_to_provider(self, val: bool) -> InputMessageContentInvoice
pub fn is_flexible(self, val: bool) -> InputMessageContentInvoice
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 moresource§impl Debug for InputMessageContentInvoice
impl Debug for InputMessageContentInvoice
source§impl<'de> Deserialize<'de> for InputMessageContentInvoice
impl<'de> Deserialize<'de> for InputMessageContentInvoice
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<InputMessageContentInvoice, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<InputMessageContentInvoice, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl PartialEq<InputMessageContentInvoice> for InputMessageContentInvoice
impl PartialEq<InputMessageContentInvoice> for InputMessageContentInvoice
source§fn eq(&self, other: &InputMessageContentInvoice) -> bool
fn eq(&self, other: &InputMessageContentInvoice) -> bool
self
and other
values to be equal, and is used
by ==
.