#joe-stubbs_code

1 messages ¡ Page 1 of 1 (latest)

marsh basinBOT
#

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

somber sage
#

When you say you're doing this, that's not literally what your code looks like is it? --> elements..update({ setupFutureUsage: 'on_session' });

eternal basin
#

No sorry it was a quick example

somber sage
eternal basin
#

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:

#

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

somber sage
#

Got it, okay. So the issue is that you don't want the page to reload? Can you elaborate on that a bit?

eternal basin
#

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

marsh basinBOT
somber sage
#

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)

eternal basin
#

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?

somber sage
#

Of course!

eternal basin
#

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)]

somber sage