#roshe10_checkout-saved-payment-methods

1 messages ยท Page 1 of 1 (latest)

severe breachBOT
#

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

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

peak tundra
#

Hello

muted aspen
#

I did not, so it means I have to ? is that the only one - I see now there is something called payment_intent_data.setup_future_usage - do I need to set that as well ?

peak tundra
#

Oh, yes, setup_future_usage is what indicates the PaymentMethod should be attached to the Customer.

#

So yes you would need to set that as well.

muted aspen
#

okay, thanks, will give it a try

muted aspen
#

does it mean I would need to manually create a client for stripe api

peak tundra
#

That's an older version -- the newest version is 81.0.0

#

So you likely need to upgrade

muted aspen
#

ohh, thanks

muted aspen
#

I updated to v81, provided both saved_payment_method_options.allow_redisplay_filters: 'always' and payment_intent_data.setup_future_usage:'on_session' still nothing

#

cus_RbBafbN0DtPNRw here is my customer, and I will generate session for him again

peak tundra
#

So try completing another Checkout Session where you do pass setup_future_usage

severe breachBOT
muted aspen
#

I'm passing it to checkout session like this

terse talon
#

HI ๐Ÿ‘‹

I'm stepping in as my colleague needs to go

#

Unfortunately, we don't see that being passed in the API request body

muted aspen
#

hi, I'm struggling with saving payment method, do i need to set this parameter as well somehow "payment_method_save":

terse talon
#

What is the overall goal here? Are you trying to collect payment while also saving the payment method for use later?

muted aspen
#

goal is that when user pays with any payment method once, next time i provide the same customerid to checkoutSession, I want him to have the payment method prePopulated

#

so he would not need to enter all details again

#

also to point i can have both payment and multiple subscription sessions (for different "products"), but the payment method of the customer on stripe should be visible to him any time on next session

#

once he has entered it for the first time

terse talon
#

It demonstrates how you can save payment methods for your customers and have the latest saved payment method re-display the next time the same customer ID is used with a Checkout Session

muted aspen
#

if I understood, by looking at this it seems only customerId is enough, but I'm already passing it by

terse talon
#

No, there are more parameters you need to pass. I recommend reading the doc carefully

muted aspen
#

maybe I don0t understand this part about, customer has a saved card, how can I be sure customer i saving a card, I see it in dashboard but that it mean it's saved ?

terse talon
#

Payment Methods can be saved by themselves, then they are only good for a single charge.

Payment methods can be saved to a Customer but that does not make them eligible for re-display on the Checkout Session page

muted aspen
#

yes, i don't understand then how can I make them eligible for re-dispaly

terse talon
#

Which is what the Checkout doc will cover

muted aspen
#

the doc you sent does not explain second step which I actually need, how customer should save a card

terse talon
#

That is not the only condition. read one more bullet below that

#

BUT please read the ENTIRE document