Skip to content

Commit

Permalink
fix: transforming billing and shipping country code to touppercase fo…
Browse files Browse the repository at this point in the history
…r applepay (#441)
  • Loading branch information
ArushKapoorJuspay authored Jun 13, 2024
1 parent 4897ed7 commit 4745fa2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Utilities/DynamicFieldsUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand All @@ -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
Expand All @@ -849,9 +851,9 @@ let getApplePayRequiredFields = (
Utils.getStateNameFromStateCodeAndCountry(
statesList,
shippingContact.administrativeArea,
shippingContact.countryCode,
shippingCountryCode,
)
| ShippingAddressCountry(_) => shippingContact.countryCode
| ShippingAddressCountry(_) => shippingCountryCode
| ShippingAddressPincode => shippingContact.postalCode
| _ => ""
}
Expand Down

0 comments on commit 4745fa2

Please sign in to comment.