#roshe10_checkout-saved-payment-methods
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/1329551134821449902
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
Are you setting saved_payment_method_options.allow_redisplay_filters: 'always': https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-saved_payment_method_options-allow_redisplay_filters ?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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 ?
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.
okay, thanks, will give it a try
go sdk does not provide saved_payment_method_options.allow_redisplay_filters: 'always' - https://pkg.go.dev/github.com/stripe/stripe-go/v74@v74.30.0#CheckoutSessionParams
does it mean I would need to manually create a client for stripe api
That's an older version -- the newest version is 81.0.0
So you likely need to upgrade
ohh, thanks
Looks like added in 78.3.0: https://github.com/stripe/stripe-go/blob/master/CHANGELOG.md#7830---2024-04-18
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
That Customer does not have an attached PaymentMethod. It looks like the Checkout Session you didn't pass setup_future_usage: https://dashboard.stripe.com/test/logs/req_oyW6IZmcva7nMX
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
So try completing another Checkout Session where you do pass setup_future_usage
I'm passing it to checkout session like this
HI ๐
I'm stepping in as my colleague needs to go
Unfortunately, we don't see that being passed in the API request body
hi, I'm struggling with saving payment method, do i need to set this parameter as well somehow "payment_method_save":
What is the overall goal here? Are you trying to collect payment while also saving the payment method for use later?
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
In that case I think you want to follow this guide: https://docs.stripe.com/payments/existing-customers
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
if I understood, by looking at this it seems only customerId is enough, but I'm already passing it by
No, there are more parameters you need to pass. I recommend reading the doc carefully
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 ?
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
yes, i don't understand then how can I make them eligible for re-dispaly
Which is what the Checkout doc will cover
the doc you sent does not explain second step which I actually need, how customer should save a card