#LUKE

1 messages · Page 1 of 1 (latest)

fresh roverBOT
sharp gulch
#

When you say "I cannot manage to setup that the payment method used with the checkout is automatically saved with the customer", what do you mean?

thorn kindle
#

well I am creating a checkout session, with the session there's automatically a customer created, I want that the Credit Card which is used as a payment method for the checkout session is saved with the customer that is created, so I can charge the customer in the future

sharp gulch
#

It should do that automatically if you are actually creating a new Customer object. Do you have a Checkout Session ID I can look at?

thorn kindle
#

cs_test_a1E2EzUBZbw7IKQJROhj1BDrbpCYduhViSU3qbS4g0MLDeUvYIpoNklSWr

#

this for example

sharp gulch
#

Ah, so it looks like you're creating guest customers, which don't act like regular Customers. When you create the Checkout Session, make sure you pass always on the customer_creation attribute to ensure the Customer is created and the Payment Method is attached: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer_creation

thorn kindle
#

customer_creation='always', is already set when I create the session @sharp gulch

sharp gulch
#

Ah, you're right. Apologies for the oversight. Let me dig a bit and get back to you

#

Apologies for the oversight, I mistakenly thought Checkout would attach the Payment Method to the Customer after a successful payment, but I guess it does not. You would need to use Checkout in setup mode, then create the payment on the backend after the customer successfully goes through the Checkout flow: https://stripe.com/docs/payments/save-and-reuse?platform=checkout

Use a supported platform to save card details and charge your customers later.