#nobody_unexpected

1 messages ยท Page 1 of 1 (latest)

dire jackalBOT
#

๐Ÿ‘‹ 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/1371705357805551666

๐Ÿ“ 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.

grizzled solstice
#

Hi sam, continuing this thread from before

#

The issue was that i would like to conditionally render an address element if the country selected is india, but the onchange event doesn't tell me any information

heady trellis
#

Hi! As per my last reply, it looks like the billing details in the value parameters will only be populated for saved payment method. So if it's a new customer you cannot get the billing details.

The only other alternatives we can think of are:

grizzled solstice
#

Yikess, this is not ideal

#

Because they require a backend call to determine whether a frontend element should be rendered. I wouldn't even be able to detect when this should happen during the frontend flow.

heady trellis
#

The first option is a frontend method.

grizzled solstice
#

I see

#

But it would have be called on every onchange

#

When someone is typing out their credit card it would be called 30+ times

#

Unless i am missing something

heady trellis
grizzled solstice
#

Unfortunately it appears you can only create the payment method after the customer presses submit

heady trellis
#

In that case, for your specific scenario, option 2 is the only way.

grizzled solstice
#

Confimation token is also created after the customer submits payment. The address element is supposed to be filled out before submission. I can't have a failed payment submission be a prerequisite for a successful one.

heady trellis
#

The only way left is to either use Address element or provide your own UI just for the postal code from the beginning.

grizzled solstice
#

Unfortunately this is an untenable situation as a developer. I would disable indian cards entirely but that is not an option either. I have no choice but to leave indian cards broken in production. I'm confident this situation is an oversight based on the docs. If there is a place to submit a bug report i would do so.

heady trellis
#

This is not a bug. We specifically do not collect the postal code for India. I will provide a feedback internally however, currently the only way around this are the options we dicussed.

grizzled solstice
#

Address element: it shouldn't have to render address element for 50+ countries just because only india does not display zip field

Custom zip field: this is complicated because many countries don't have zip. Since there's no way to detect which country is currently selected: if i have my own zip field, it will always be rendered, even though many times it should not be asked in the first place.

So i can't see how this isn't a bug, honestly. I appreciate the internal feedback.

heady trellis
#

Custom zip field: this is complicated because many countries don't have zip. Since there's no way to detect which country is currently selected: if i have my own zip field, it will always be rendered, even though many times it should not be asked in the first place.

The only alternative is to inspect the payment method details from the confirmation token.

#

I appreciate the internal feedback.

I will file a feedback. ๐Ÿ‘