#stealth_cardelement-postalcode
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1215721295812231209
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- stealth_unexpected, 2 days ago, 10 messages
If I enter 5 digits then validation works.
Is there a way to disable ZIP code validation?
Correction. HidePostalCode = false
The Card Element is a bit older and has edge cases like this where it uses the card BIN to know which country validation it use for the postal code
I just found documentation. So with test cards ZIP is always US code. But in production, ZIP code should work with CC issued in different country?
Yeah if you were to try one of our internation test cards you should see different behavior (https://docs.stripe.com/testing#international-cards)
When I use one of international cards post field disappears
Yeah because some countries don't have the concept of a postal code - if you were to try one of the GB cards you'd see it
I tried Slovenia. And there are postal codes
stealth_cardelement-postalcode
I mean... In Slovenia there are postal codes. Card element does not show the field tho
For some countries we also choose not to collect postal codes - I don't think we have a canonical list
If always grabbing the potsal code is something that's important to your integration I'd suggest hiding it in the card element and collecting it through your own UI (so you have control over when to collect it). Alternatively, you could look into using Payment Element which is newer and has slightly different logic for when to collect postal code
I will take a look into payment element. Thank you
๐
It appears that PE does not have ZIP code for Slovenia either.
Is there a property in card elements / PM elements that I can use to determine if ZIP code is supported or not?
Hi ๐
Can you share the code you are using to create and mount the payment element and a screenshot of what you see?
I did not write the code yet. I used preview on Stripe website and saw it does not show ZIP field if I select Slovenia.
Here: https://dashboard.stripe.com/settings/payment_methods?platform_id=pmc_1K6d66GpJlO3RAQZoj4Ugp1b
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
If I select US, then ZIP code appears at the bottom
This is checkout but I assume payment element will work the same way
Only US and UK have ZIP code field. No other country has it
As my colleague stated, this is expected. If you require postal code collection all the time, you should add an input to collect this in your integration. By default the Payment Element only collects the information it needs depending on the Payment Method and the country.