diff --git a/src/Utilities/DynamicFieldsUtils.res b/src/Utilities/DynamicFieldsUtils.res index 13b62e520..976d62f7f 100644 --- a/src/Utilities/DynamicFieldsUtils.res +++ b/src/Utilities/DynamicFieldsUtils.res @@ -818,6 +818,9 @@ let getApplePayRequiredFields = ( addressLines->Array.get(index)->Option.getOr("") } + let billingCountryCode = billingContact.countryCode->String.toUpperCase + let shippingCountryCode = shippingContact.countryCode->String.toUpperCase + let fieldVal = switch item.field_type { | FullName | BillingName => @@ -833,11 +836,10 @@ let getApplePayRequiredFields = ( Utils.getStateNameFromStateCodeAndCountry( statesList, billingContact.administrativeArea, - billingContact.countryCode, + billingCountryCode, ) | Country - | AddressCountry(_) => - billingContact.countryCode + | AddressCountry(_) => billingCountryCode | AddressPincode => billingContact.postalCode | Email => shippingContact.emailAddress | PhoneNumber => shippingContact.phoneNumber @@ -849,9 +851,9 @@ let getApplePayRequiredFields = ( Utils.getStateNameFromStateCodeAndCountry( statesList, shippingContact.administrativeArea, - shippingContact.countryCode, + shippingCountryCode, ) - | ShippingAddressCountry(_) => shippingContact.countryCode + | ShippingAddressCountry(_) => shippingCountryCode | ShippingAddressPincode => shippingContact.postalCode | _ => "" }