SuccessfulPayment constructor

const SuccessfulPayment({
  1. @JsonKey(name: 'currency') required String currency,
  2. @JsonKey(name: 'total_amount') required int totalAmount,
  3. @JsonKey(name: 'invoice_payload') required String invoicePayload,
  4. @JsonKey(name: 'shipping_option_id') String? shippingOptionId,
  5. @JsonKey(name: 'order_info') OrderInfo? orderInfo,
  6. @JsonKey(name: 'telegram_payment_charge_id') required String telegramPaymentChargeId,
  7. @JsonKey(name: 'provider_payment_charge_id') required String providerPaymentChargeId,
  8. @JsonKey(name: 'is_recurring') bool? isRecurring,
  9. @JsonKey(name: 'is_first_recurring') bool? isFirstRecurring,
})

Constructs a SuccessfulPayment object

Implementation

const factory SuccessfulPayment({
  /// Three-letter ISO 4217 currency code
  @JsonKey(name: 'currency') required String currency,

  /// 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](https://core.telegram.org/bots/payments/currencies.json),
  /// it shows the number of digits past the decimal point for each currency
  /// (2 for the majority of currencies).
  @JsonKey(name: 'total_amount') required int totalAmount,

  /// Bot specified invoice payload
  @JsonKey(name: 'invoice_payload') required String invoicePayload,

  /// Optional. Identifier of the shipping option chosen by the user
  @JsonKey(name: 'shipping_option_id') String? shippingOptionId,

  /// Optional. Order info provided by the user
  @JsonKey(name: 'order_info') OrderInfo? orderInfo,

  /// Telegram payment identifier
  @JsonKey(name: 'telegram_payment_charge_id')
  required String telegramPaymentChargeId,

  /// Provider payment identifier
  @JsonKey(name: 'provider_payment_charge_id')
  required String providerPaymentChargeId,

  /// Optional. True, if the payment is a recurring payment for a subscription
  @JsonKey(name: 'is_recurring') bool? isRecurring,

  /// Optional. True, if the payment is the first payment for a subscription
  @JsonKey(name: 'is_first_recurring') bool? isFirstRecurring,
}) = _SuccessfulPayment;