PaymentForm.fromJson constructor
Parses a PaymentForm from TDLib JSON.
Implementation
factory PaymentForm.fromJson(Map<String, dynamic> json) => PaymentForm(
id: _readInt(json['id']),
invoice: _readObject(json['invoice'], Invoice.fromJson),
sellerBotUserId: _readInt(json['seller_bot_user_id']),
paymentProviderUserId: _readInt(json['payment_provider_user_id']),
paymentProvider:
_readObject(json['payment_provider'], PaymentProvider.fromJson),
additionalPaymentOptions: _readList<PaymentOption>(
json['additional_payment_options'],
(e) => _readObject(e, PaymentOption.fromJson)),
savedOrderInfo:
_readOptional(json['saved_order_info'], OrderInfo.fromJson),
savedCredentials: _readList<SavedCredentials>(json['saved_credentials'],
(e) => _readObject(e, SavedCredentials.fromJson)),
canSaveCredentials: _readBool(json['can_save_credentials']),
needPassword: _readBool(json['need_password']),
productTitle: _readString(json['product_title']),
productDescription:
_readObject(json['product_description'], FormattedText.fromJson),
productPhoto: _readOptional(json['product_photo'], Photo.fromJson),
extra: json['@extra'],
clientId: _readClientId(json['@client_id']),
);