#rookiemonkey_kw
1 messages · Page 1 of 1 (latest)
The saved payment method will only be pre-filled in a Checkout Session when customer field is set and following conditions are met:
A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer’s card details.
From: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer
got it. i also found this one https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
so i think i'll update the default payment method (based on their chosen card on our app) then create checkout session?
invoice_settings.default_payment_method field is only applicable for invoice and subscription payments, but not one-time payment with Checkout Session in mode:'payment'
i see, but we are already providing the customer id on customer field and it prefills the necessary information however it uses the last used payment method.
user chose Card 2 on our app, went to pay redirected to Stripe Checkout and yes it prefills everything but it defaults to Card 1 instead
we are already providing the customer id on customer field and it prefills the necessary information however it uses the last used payment method.
Yes! This is expected. Checkout Session only pre-fills the last used payment method and doesn't support full list of saved payment methods for customer to choose from.
If you wish to display saved payment methods, it can only be done with your integration by retrieving customer's saved payment methods with List Customer's Payment Methods API https://stripe.com/docs/api/payment_methods/customer_list and display in your own website.
thanks, yes exactly that what we are doing already
but if user chooses the 2nd card, the stripe checkout session shows the last used payment method,
so i'm thinking is there a way for to specify which payment method to use for the checkout session?
Unfortunately, Checkout Session doesn't support specifying the payment method, i.e. it will only show the last used payment method
You may create a Payment Intent and charge to the selected saved payment method directly (instead of using Checkout Session). Please refer to this guide for more information: https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=elements#charge-saved-payment-method
got it no worries. this would be my last option. Thanks @robust moss! 🙏