toJson method

Map<String, dynamic> toJson()

Converts this FawryLaunchModel to a JSON format.

Implementation

Map<String, dynamic> toJson() {
  List<Map<String, dynamic>> chargeItemsJson =
      chargeItems.map((item) => item.toJson()).toList();

  Map<String, dynamic>? launchCustomerJson = launchCustomerModel?.toJson();

  Map<String, dynamic> launchMerchantJson = launchMerchantModel.toJson();

  return {
    'allow3DPayment': allow3DPayment,
    'chargeItems': chargeItemsJson,
    'launchCustomerModel': launchCustomerJson,
    'launchMerchantModel': launchMerchantJson,
    'skipLogin': skipLogin,
    'skipReceipt': skipReceipt,
    'merchant': launchMerchantJson,
    'customer': launchCustomerJson,
    'skipCustomerInput': skipLogin,
    'allowVoucher': false,
    'payWithCardToken': payWithCardToken,
    'paymentWithCardToken': payWithCardToken,
    'paymentMethods': paymentMethods?.toShortString(),
    'paymentMethod': paymentMethods?.toShortString(),
  };
}