pub struct Invoice {
pub title: String,
pub description: String,
pub start_parameter: String,
pub currency: String,
pub total_amount: i64,
}Expand description
This object contains basic information about an invoice.
Fields§
§title: StringProduct name
description: StringProduct description
start_parameter: StringUnique bot deep-linking parameter that can be used to generate this invoice
currency: StringThree-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
total_amount: i64Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass 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).
Implementations§
Source§impl Invoice
impl Invoice
pub fn new( title: String, description: String, start_parameter: String, currency: String, total_amount: i64, ) -> Self
Sourcepub fn get_description<'a>(&'a self) -> &'a str
pub fn get_description<'a>(&'a self) -> &'a str
Product description
Sourcepub fn set_description<'a>(&'a mut self, description: String) -> &'a mut Self
pub fn set_description<'a>(&'a mut self, description: String) -> &'a mut Self
Product description
Sourcepub fn get_start_parameter<'a>(&'a self) -> &'a str
pub fn get_start_parameter<'a>(&'a self) -> &'a str
Unique bot deep-linking parameter that can be used to generate this invoice
Sourcepub fn set_start_parameter<'a>(
&'a mut self,
start_parameter: String,
) -> &'a mut Self
pub fn set_start_parameter<'a>( &'a mut self, start_parameter: String, ) -> &'a mut Self
Unique bot deep-linking parameter that can be used to generate this invoice
Sourcepub fn get_currency<'a>(&'a self) -> &'a str
pub fn get_currency<'a>(&'a self) -> &'a str
Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
Sourcepub fn set_currency<'a>(&'a mut self, currency: String) -> &'a mut Self
pub fn set_currency<'a>(&'a mut self, currency: String) -> &'a mut Self
Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
Sourcepub fn get_total_amount<'a>(&'a self) -> i64
pub fn get_total_amount<'a>(&'a self) -> i64
Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass 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 set_total_amount<'a>(&'a mut self, total_amount: i64) -> &'a mut Self
pub fn set_total_amount<'a>(&'a mut self, total_amount: i64) -> &'a mut Self
Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass 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).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Invoice
impl<'de> Deserialize<'de> for Invoice
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<NoSkipInvoice> for Invoice
impl From<NoSkipInvoice> for Invoice
Source§fn from(t: NoSkipInvoice) -> Self
fn from(t: NoSkipInvoice) -> Self
Source§impl Into<NoSkipInvoice> for Invoice
impl Into<NoSkipInvoice> for Invoice
Source§fn into(self) -> NoSkipInvoice
fn into(self) -> NoSkipInvoice
Source§impl Ord for Invoice
impl Ord for Invoice
Source§impl PartialOrd for Invoice
impl PartialOrd for Invoice
impl Eq for Invoice
impl StructuralPartialEq for Invoice
Auto Trait Implementations§
impl Freeze for Invoice
impl RefUnwindSafe for Invoice
impl Send for Invoice
impl Sync for Invoice
impl Unpin for Invoice
impl UnsafeUnpin for Invoice
impl UnwindSafe for Invoice
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.