getReadyModelCards function
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(),
};
}