Invoice constructor

const Invoice({
  1. @JsonKey(name: 'title') required String title,
  2. @JsonKey(name: 'description') required String description,
  3. @JsonKey(name: 'start_parameter') required String startParameter,
  4. @JsonKey(name: 'currency') required String currency,
  5. @JsonKey(name: 'total_amount') required int totalAmount,
})

Constructs an Invoice object

Implementation

const factory Invoice({
  /// Product name
  @JsonKey(name: 'title') required String title,

  /// Product description
  @JsonKey(name: 'description') required String description,

  /// Unique bot deep-linking parameter that can be used to generate this
  /// invoice
  @JsonKey(name: 'start_parameter') required String startParameter,

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