#suraj-parwani_api
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/1262358563716730960
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi! any more details on what you're referring to exactly?
So we have integrated checkout flow in my application. So card number, cvv name and pincode are mounted on the application. Now for the pincode validation is a mandatory field and is handled by stripe.
Customer is from India and card is from india and india has 5 digit pincode.
but stripe is throwing error for this
Can you help me with this?
by pincode do you mean 3D Secure?
Nope. postal code
I see. then why did you say pincode isntead of postcode?
Sorry fo that, but in india its referred as pincode ๐
anyway, this should just work if you integrate using the recommended flow(using the PaymentElement). How have you integrated, what does your code look like?
Yes i am using the PaymentElement
then it will just work really, the customer picks India as the country in the country dropdown in the PaymentElement, and the postal code input will validate for Indian-specific postcode formats. If you're facing a problem with this I will need a lot more information than just "it throws error".
it says postal code should be 6 digits
My understanding (via quick search) is that the IN system uses 6 digits postal/pin codes, no?
Then I'm not sure what is unexpected?
system is allowing 5 digits and indian postalcodes are 6 digitst
If you're trying to submit the Element without providing a ZIP/PIN code that meets the validation that it will error yes
Let me correct the statement
user is from india
and when user is coming to my application and entering indian card, the system is throwing validation that postal code should be 5 digits
but indian postal codes are of 6 digits. And this validation is handled by stripe
Not able to find the root cause for this
PaymentElement doesn't ask for a postal code when the location is India(it's only required in certain countries as part of https://docs.stripe.com/disputes/prevention/verification#avs-check ), so again I think we need much more specific information from you like exact code and screenshots.
Well that is not the Payment Element. To be clear, are you building your own Stripe integration? Or is this some kind of plugin?
This is the custom checkout which stripe has offered.
What is 'custom checkout'? Which APIs and payment UIs are you using? Some code will be useful
That's just a docs link, what actual Stripe code have you used to render that form
Should i share the code snippet here?
I'd guess it's the Split Card Elements
Yes
this.cardnumber = this.elements.create('cardNumber', {
showIcon: true,
placeholder: 'Card number',
});
this.cardnumber.addEventListener('change', this.cardHandler);
this.cardnumber.mount(this.stripecardnumber.nativeElement);
this.cardExpiry = this.elements.create('cardExpiry');
this.cardExpiry.mount(this.stripecardexpiry.nativeElement);
this.cardCvc = this.elements.create('cardCvc');
this.cardCvc.mount(this.stripecardcvc.nativeElement);
this.cardPostal = this.elements.create('postalCode', {
placeholder: 'ZIP',
});
this.cardPostal.mount(this.stripecardzip.nativeElement);
This is my sample code. which basically mounts the elements
So yes, Split Card Element. AFAIK, that postalCode Element is mostly deprecated which is why it's undocumented and likely doesn't validate postal codes that are regional specific
i.e. it just expects a 5 character string as that is what US zip codes are
This is unlikely to be fixed/changed because it's deprecated and we don't encourage usage of it. I'd recommend implementing your own ZIP code field
but is it necessary for the making the payment ?
By default our UIs (Payment Element, Checkout) will collect ZIP/postal codes in certain locales it is increased auth rates: https://docs.stripe.com/disputes/prevention/verification#avs-check
but for other users from india then the validations are working perfectly
I don't know what that means
Other user who are from india are trying to make purchases and entering 6 digit postal codes, works perfectly for them
As I said, the validation probably only checked for at least 5 characters
So both 5 and 6 postal codes input will be fine
the validation is only working if i dont enter the zip code
if i enter 1 digit as well its working fine
As I said, this Element is deprecated so there are no plans to change/fix how the validation works
If this is important to you, then you should use Payment Element and/or your own ZIP code field
What is an alternative for this
I just said, use Payment Element