#neil_code

1 messages ยท Page 1 of 1 (latest)

tranquil houndBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

eternal zodiac
#

Hello

#

You are using the deferred-intent flow here?

pure sandal
eternal zodiac
#

Gotcha, and your goal is to ensure that the customer does save their PaymentMethod for redisplay every time?

pure sandal
#

save their PaymentMethod for redisplay every time
yes and more importantly saves their payment method for future off-session payments

#

^ I've confirmed that part is working. When the checkbox is selected the rest of the options are configured such that off-session paymetns are working

#

just need to enforce that the checkbox gets selected

#

oh wait, are you about to tell me that setup_future_usage: off_session takes care of that?

#

and checkbox is just for redisplay purpose?

eternal zodiac
#

Okay gotcha. So really what you want here is to not use a Customer Session at all for saving a new PaymentMethod. Instead, you set setupFutureUsage when creating your Elements object and you set setup_future_usage server-side when confirming your PaymentIntent.

When you create the confirmationToken you can set payment_method_data.allow_redisplay: 'always': https://docs.stripe.com/js/confirmation_tokens/create_confirmation_token

#

But overall, yes, what you just stated is correct -- the checkbox there is only to give the customer the choice on whether their PaymentMethod should be redisplayed or not.

#

The actual dictation of whether it is saved or not is based on setup_future_usage.

pure sandal
#

I see, super helpful. Thanks. Will let you know how it goes

eternal zodiac
#

๐Ÿ‘

pure sandal
#

just to confirm, does it hurt to use the customer session or you recommend booting that all together?

eternal zodiac
#

You do want to use the Customer Session if you want to redisplay saved PaymentMethods in Payment Element, yes.