#nobody_unexpected

1 messages · Page 1 of 1 (latest)

harsh bisonBOT
#

đź‘‹ 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/1369521327635173376

📝 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.

dry marsh
#

Here's the stripe docs - it even says india requires postal

#

You can see united states & canada also require it: the payment element asks for the zip in these cases.

flint bobcat
#

Using a payment element, with an indian card specifically, causes tax calculations to fail (no other country has this issue)
Could you clarify where do you actually see the error? Any request id? (req_xxx)

#

The PaymentElements is designed for successful transaction, not specifically for tax as well.

harsh bisonBOT
dry marsh
#

Yeah i understand that but there doesn't appear to be a workaround either

#

Of course I don't want to render an address element every time because of one edge case. So i'd have to detect if the card being entered is India

#

Let me get an error request

#

req_HWYS0yVQnLjXls

cedar hornet
dry marsh
#

Hmm - does it support confirmation tokens? (i dont see it mentioned on the page)

#

The reason i went with payment elements is because i confirm the payment server side

cedar hornet
#

Let me just check on this. Give me a moment.

cedar hornet
#

Thanks for waiting! You cannot use confirmation token with checkout. So some possible solutions are:

  • Option 1: Listen to paymentElement's change event [0], inspect the value in the event. If the billing_details.address.country is IN, you can conditionally render address element or your own UI to collect post code
  • Option 2: You can inspect the payment method after it's collected. If the country is IN then you can use address element or your own UI to collect post code.

[0] https://docs.stripe.com/js/element/events/on_change?type=paymentElement

dry marsh
#

Yeah i'm trying to do option 1, but the onchange value prints undefined when you're entering a card. I attached images of the event.value of a saved card vs when you're filling it out

cedar hornet
#

What is the difference between the 2 screenshots? As in how did you get each?

dry marsh
#

It's whether you've selected a saved card or not

#

Presumably you can't access the card information from a customer as it's getting filled out

cedar hornet
dry marsh
#

Just the card

#

Want to keep collection to minimum

dry marsh
#

Set billing details and field to auto, unfortunately the result is the same as before

cedar hornet
#

You output still shows detected billing country not found?

dry marsh
#

Yeah

cedar hornet
#

Give me a moment

dry marsh
#

I have to be going but i will be making the same post tomorrow. Thank you