PaymentForm.fromJson constructor

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

Parse from a json

Implementation

factory PaymentForm.fromJson(Map<String, dynamic> json) => PaymentForm(
      id: int.parse(json['id']),
      invoice: Invoice.fromJson(json['invoice']),
      sellerBotUserId: json['seller_bot_user_id'],
      paymentProviderUserId: json['payment_provider_user_id'],
      paymentProvider: PaymentProvider.fromJson(json['payment_provider']),
      additionalPaymentOptions: List<PaymentOption>.from(
          (json['additional_payment_options'] ?? [])
              .map((item) => PaymentOption.fromJson(item))
              .toList()),
      savedOrderInfo: json['saved_order_info'] == null
          ? null
          : OrderInfo.fromJson(json['saved_order_info']),
      savedCredentials: List<SavedCredentials>.from(
          (json['saved_credentials'] ?? [])
              .map((item) => SavedCredentials.fromJson(item))
              .toList()),
      canSaveCredentials: json['can_save_credentials'],
      needPassword: json['need_password'],
      productTitle: json['product_title'],
      productDescription: FormattedText.fromJson(json['product_description']),
      productPhoto: json['product_photo'] == null
          ? null
          : Photo.fromJson(json['product_photo']),
      extra: json['@extra'],
      clientId: json['@client_id'],
    );