MessageInvoice.fromJson constructor

MessageInvoice.fromJson(
  1. Map<String, dynamic> json
)

Parses a MessageInvoice from TDLib JSON.

Implementation

factory MessageInvoice.fromJson(Map<String, dynamic> json) => MessageInvoice(
  productInfo: _readObject(json['product_info'], ProductInfo.fromJson),
  currency: _readString(json['currency']),
  totalAmount: _readInt(json['total_amount']),
  startParameter: _readString(json['start_parameter']),
  isTest: _readBool(json['is_test']),
  needShippingAddress: _readBool(json['need_shipping_address']),
  receiptMessageId: _readInt(json['receipt_message_id']),
  paidMedia: _readOptional(json['paid_media'], PaidMedia.fromJson),
  paidMediaCaption: _readOptional(
    json['paid_media_caption'],
    FormattedText.fromJson,
  ),
);