#nobody_unexpected
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/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.
- nobody_api, 20 hours ago, 22 messages
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.
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.
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
Hi there, I'm stepping in for my colleague. Have you thought about using our Embedded Components? It still utilises Stripe Elements, but it can assist with the issue you're facing—collecting relevant tax details—by also integrating Checkout Sessions.
https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=embedded-components
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
Let me just check on this. Give me a moment.
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
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
What is the difference between the 2 screenshots? As in how did you get each?
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
Are you collecting billing details in your Payment Element: https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails?
Does it work if you just keep country as auto: https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails-address-country ?
Set billing details and field to auto, unfortunately the result is the same as before
You output still shows detected billing country not found?
Yeah
Give me a moment
I have to be going but i will be making the same post tomorrow. Thank you