pub struct SuccessfulPayment {
pub currency: String,
pub invoice_payload: String,
pub provider_payment_charge_id: String,
pub telegram_payment_charge_id: String,
pub total_amount: Integer,
pub is_first_recurring: Option<bool>,
pub is_recurring: Option<bool>,
pub order_info: Option<OrderInfo>,
pub shipping_option_id: Option<String>,
pub subscription_expiration_date: Option<Integer>,
}
Expand description
Represents a successful payment.
Fields§
§currency: String
Three-letter ISO 4217 currency code.
invoice_payload: String
Bot specified invoice payload.
provider_payment_charge_id: String
Provider payment identifier.
telegram_payment_charge_id: String
Telegram payment identifier.
total_amount: Integer
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).
is_first_recurring: Option<bool>
Whether the payment is the first payment for a subscription.
is_recurring: Option<bool>
Whether the payment is a recurring payment for a subscription.
order_info: Option<OrderInfo>
Order info provided by the user.
shipping_option_id: Option<String>
Identifier of the shipping option chosen by the user.
subscription_expiration_date: Option<Integer>
Expiration date of the subscription, in Unix time; for recurring payments only.
Implementations§
Source§impl SuccessfulPayment
impl SuccessfulPayment
Sourcepub fn new<A, B, C, D>(
currency: A,
invoice_payload: B,
provider_payment_charge_id: C,
telegram_payment_charge_id: D,
total_amount: Integer,
) -> Self
pub fn new<A, B, C, D>( currency: A, invoice_payload: B, provider_payment_charge_id: C, telegram_payment_charge_id: D, total_amount: Integer, ) -> Self
Creates a new SuccessfulPayment
.
§Arguments
currency
- Three-letter ISO 4217 currency code.invoice_payload
- Bot specified invoice payload.provider_payment_charge_id
- Provider payment identifier.telegram_payment_charge_id
- Telegram payment identifier.total_amount
- Total price.
Sourcepub fn with_is_first_recurring(self, value: bool) -> Self
pub fn with_is_first_recurring(self, value: bool) -> Self
Sets a new value for the is_first_recurring
flag.
§Arguments
value
- Whether the payment is the first payment for a subscription.
Sourcepub fn with_is_recurring(self, value: bool) -> Self
pub fn with_is_recurring(self, value: bool) -> Self
Sets a new value for the is_recurring
flag.
§Arguments
value
- Whether the payment is a recurring payment for a subscription.
Sourcepub fn with_order_info(self, value: OrderInfo) -> Self
pub fn with_order_info(self, value: OrderInfo) -> Self
Sourcepub fn with_shipping_option_id<T>(self, value: T) -> Self
pub fn with_shipping_option_id<T>(self, value: T) -> Self
Sourcepub fn with_subscription_expiration_date(self, value: Integer) -> Self
pub fn with_subscription_expiration_date(self, value: Integer) -> Self
Sets a new subscription expiration date
§Arguments
value
- Expiration date of the subscription, in Unix time; for recurring payments only.
Trait Implementations§
Source§impl Clone for SuccessfulPayment
impl Clone for SuccessfulPayment
Source§fn clone(&self) -> SuccessfulPayment
fn clone(&self) -> SuccessfulPayment
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more