pub struct InputMessageContentInvoice {Show 20 fields
pub title: String,
pub description: String,
pub payload: String,
pub provider_token: Option<String>,
pub currency: String,
pub prices: Vec<LabeledPrice>,
pub max_tip_amount: Option<u32>,
pub suggested_tip_amounts: Option<Vec<u32>>,
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: StringProduct name, 1-32 characters
description: StringProduct description, 1-255 characters
payload: StringBot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
provider_token: Option<String>Payment provider token, obtained via @Botfather.
Pass None for payments in Telegram Stars.
currency: StringThree-letter ISO 4217 currency code, see more on currencies. Pass
XTR for payments in Telegram Stars.
prices: Vec<LabeledPrice>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>>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, C, PR>(
title: T,
description: D,
payload: PA,
currency: C,
prices: PR,
) -> InputMessageContentInvoicewhere
T: Into<String>,
D: Into<String>,
PA: Into<String>,
C: Into<String>,
PR: IntoIterator<Item = LabeledPrice>,
pub fn title<T>(self, val: T) -> InputMessageContentInvoice
pub fn description<T>(self, val: T) -> InputMessageContentInvoice
pub fn payload<T>(self, val: T) -> InputMessageContentInvoice
pub fn provider_token<T>(self, val: T) -> InputMessageContentInvoice
pub fn currency<T>(self, val: T) -> 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) -> InputMessageContentInvoice
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 Serialize for InputMessageContentInvoice
impl Serialize for InputMessageContentInvoice
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for InputMessageContentInvoice
Auto Trait Implementations§
impl Freeze for InputMessageContentInvoice
impl RefUnwindSafe for InputMessageContentInvoice
impl Send for InputMessageContentInvoice
impl Sync for InputMessageContentInvoice
impl Unpin for InputMessageContentInvoice
impl UnwindSafe for InputMessageContentInvoice
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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