#joe-stubbs_code
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/1237448413415604267
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
When you say you're doing this, that's not literally what your code looks like is it? --> elements..update({ setupFutureUsage: 'on_session' });
No sorry it was a quick example
Are you creating a Payment Intent or Setup Intent ahead of rendering the Payment Element? Or are you using the deferred intent flow? (e.g. https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=setup)
Oh so sorry, i posted the wrong link too, apologies - i was excited about my first post, so this is what i meant to send:
https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment#web-fulfillment
So we create the Stripe Payment Element, then click our pay button which then triggers the call to get a client secret from our BE and then call stripe.confirmPayment
We pass a boolean as to if the card should be stored or not to our BE before they create the client secret
Got it, okay. So the issue is that you don't want the page to reload? Can you elaborate on that a bit?
Sure thing, so if i follow the guide above, i see a handful of payment options as per my Stripe setup. However if i follow the guide and call confirmPayment then i get an error saying "The provided setup_future_usage (on_session) does not match the expected setup_future_usage (null)".
A way to remove this error is to call elements.update({ setupFutureUsage: 'on_session' }) before calling confirmPayment but by performing this option, the Stripe Payment Element reloads....
Gotcha, yeah that's unfortunately expected behavior, so I think the best thing to do would be to fix it in the UI flow (e.g. ask if they intend to save their payment method before they fill out the Payment Element)
Haha uh oh, i was scared you'd say that but i do totally understand that! If it's expected thats fair enough!
Am i allowed to ask one more Q here about the setup for the element? It's somewhat releated?
Of course!
thank you so much and thanks for your patience!
Our current checkout with the legacy payment doesnt really use the billing address, we are a gifting platform so the address taken is usually the recipient.
The new Stripe Payment Element for card has the country and post code inputs.... i do understand i can hide them but if i hide them i NEED to send them on confirm right?
Is that a 100% requirement?
Just because in the current legacy element its not (but i can understand if say this at the very least is a security feature)]
I believe Stripe will still ask for postal code, but you can specify never for all the other address fields: https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails