Invoice.fromJson constructor

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

Parses a Invoice from TDLib JSON.

Implementation

factory Invoice.fromJson(Map<String, dynamic> json) => Invoice(
      currency: _readString(json['currency']),
      priceParts: _readList<LabeledPricePart>(json['price_parts'],
          (e) => _readObject(e, LabeledPricePart.fromJson)),
      maxTipAmount: _readInt(json['max_tip_amount']),
      suggestedTipAmounts:
          _readList<int>(json['suggested_tip_amounts'], _readInt),
      recurringPaymentTermsOfServiceUrl:
          _readString(json['recurring_payment_terms_of_service_url']),
      termsOfServiceUrl: _readString(json['terms_of_service_url']),
      isTest: _readBool(json['is_test']),
      needName: _readBool(json['need_name']),
      needPhoneNumber: _readBool(json['need_phone_number']),
      needEmailAddress: _readBool(json['need_email_address']),
      needShippingAddress: _readBool(json['need_shipping_address']),
      sendPhoneNumberToProvider:
          _readBool(json['send_phone_number_to_provider']),
      sendEmailAddressToProvider:
          _readBool(json['send_email_address_to_provider']),
      isFlexible: _readBool(json['is_flexible']),
    );