#Umbrella-postal-code
1 messages · Page 1 of 1 (latest)
That's sad. Is the only way to make it work with a custom card element is to prompt a user to select a country and ask or not ask the user to enter zip/postal code based on the selected country? In order to make it work 'd have to keep all the countries in the code plus keep what kind of system all the countries use(zip/postal code), which seems like a lot of pain to implement...
Unfortunately, yes at the moment yes you would need to do the logic yourself
Or find an existing library that helps with this
got it, thanks for the help
@trim steeple for what it's worth, relying on the card's BIN is quite problematic. For example if you live in the US but have a Canadian card we expect a Canadian postal code, so it can cause issues. We're re-designing a new element and in that one we also ask for country + postal code instead
Is the safest bet for me to prompt the user to select a country rather than to rely on CardElement inferring user's country based on card number?
you can't rely on Elements inferring the country if you do your own postal code, so yes you need to ask for the country