#priya-paymentelement-requirements
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
- priya_97027, 4 days ago, 10 messages
- priya-elements-ready, 4 days ago, 6 messages
- priya_97027, 4 days ago, 19 messages
- priya_97027, 5 days ago, 58 messages
Hi 👋 no there isn't a way to do that, and as far as I'm aware the Card Element doesn't offer that either since you can't derive a billing postal code from a card number itself.
You can suppress the collection of postal codes and supply ones you collect instead if you would prefer. You can set this field to never:
https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails-address-postalCode
okay so I have country info then I want to show the zip or postal code input field based on that. Is there a way to send the country to payment element and show the zip code that way?
Based on county, showing or not showing postal code is something payment element can handle?
Yes, you can provide a country that you've already collected, via the defaultValues parameter:
https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-defaultValues-billingDetails-address-country
I believe the element will suppress zip/postal collection for countries that don't have those. If it doesn't you can manually set it via the fields parameter I referenced above.
Just for the info this country is specific to the card we input?
I don't understand the question.
I am saying the country and postal code info needed while paying is the billing address of the card right?
Yup
okay. One another question ... If I do not specify any default value of country, it will be taking the present location of the user by default?
I believe so
Thank You
Any time!