executePaymentRequest method

Map<String, dynamic> executePaymentRequest(
  1. int paymentMethod
)

Implementation

Map<String, dynamic> executePaymentRequest(int paymentMethod) {
  var data = {
    "PaymentMethodId": paymentMethod,
    "CustomerName": customerName,
    "DisplayCurrencyIso": _currencies[currencyIso],
    "MobileCountryCode": mobileCountryCode,
    "CustomerMobile": customerMobile,
    "CustomerEmail": customerEmail,
    "InvoiceValue": invoiceAmount,
    "Language": _languages[language],
    "CustomerReference": customerReference,
    "CustomerCivilId": customerCivilId,
    "UserDefinedField": userDefinedField,
    "CustomerAddress": customerAddress?.toJson(),
    "ExpiryDate": expiryDate?.toUtc().toIso8601String(),
    "InvoiceItems": invoiceItems?.map<Map<String, dynamic>>((e) {
      return e.toJson();
    }).toList(),
    "ShippingMethod": shippingMethod,
    "ShippingConsignee": shippingConsignee?.toJson(),
    "Suppliers": suppliers?.map<Map<String, dynamic>>((e) {
      return e.toJson();
    }).toList(),
    "RecurringModel": recurringModel?.toJson(),
  };
  data.removeWhere((key, value) => value == null);
  return data;
}