getReadyModelCards function

Map<String, dynamic> getReadyModelCards({
  1. required List<String> brands,
  2. required String checkoutId,
  3. required String shopperResultUrl,
  4. required String lang,
  5. required PaymentMode paymentMode,
  6. required String merchantId,
  7. required String countryCode,
  8. String? companyName = "",
  9. String? themColorHexIOS,
  10. required bool setStorePaymentDetailsMode,
})

This function retrieves the necessary attributes to create a ready-to-use model card. It takes in the required parameters of brand, checkoutId, shopperResultUrl, lang, paymentMode, and setStorePaymentDetailsMode. An optional parameter, themColorHexIOS, can also be provided. The function returns a Map with the corresponding values of type, mode, checkoutid, brand, lang, themColorHexIOS, ShopperResultUrl, and setStorePaymentDetailsMode.

Implementation

Map<String, dynamic> getReadyModelCards(
    {required List<String> brands,
    required String checkoutId,
    required String shopperResultUrl,
    required String lang,
    required PaymentMode paymentMode,
    required String merchantId,
    required String countryCode,
    String? companyName = "",
    String? themColorHexIOS,
    required bool setStorePaymentDetailsMode}) {
  return {
    "type": PaymentConst.readyUi,
    "mode": paymentMode.toString().split('.').last,
    "checkoutid": checkoutId,
    "brand": brands,
    "lang": lang,
    "merchantId": merchantId,
    "CountryCode": countryCode,
    "companyName": companyName ?? "",
    "themColorHexIOS": themColorHexIOS ?? "",
    "ShopperResultUrl": shopperResultUrl,
    "setStorePaymentDetailsMode": setStorePaymentDetailsMode.toString(),
  };
}