PreCheckoutQuery constructor

const PreCheckoutQuery({
  1. @JsonKey(name: 'id') required String id,
  2. @JsonKey(name: 'from') required User from,
  3. @JsonKey(name: 'currency') required String currency,
  4. @JsonKey(name: 'total_amount') required int totalAmount,
  5. @JsonKey(name: 'invoice_payload') required String invoicePayload,
  6. @JsonKey(name: 'shipping_option_id') String? shippingOptionId,
  7. @JsonKey(name: 'order_info') OrderInfo? orderInfo,
})

Constructs a PreCheckoutQuery object

Implementation

const factory PreCheckoutQuery({
  /// Unique query identifier
  @JsonKey(name: 'id') required String id,

  /// User who sent the query
  @JsonKey(name: 'from') required User from,

  /// 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, 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,
}) = _PreCheckoutQuery;