#Arnjeir
1 messages ยท Page 1 of 1 (latest)
๐ Hi there, Happy to help!
If you didnโt create the Checkout Session with an existing customer, use the payment_method ID to attach the PaymentMethod to a Customer. After you attach the PaymentMethod to a customer, you can charge the PaymentMethod using a PaymentIntent
https://stripe.com/docs/payments/save-and-reuse?platform=checkout#use-payment-method
I'm passing a customer ๐๐ผ my issue was the payment method added to the customer isn't set as the default so any future payments done via PaymentIntents fails complaining about no payment method.
I guess it looks like we either 1. Have to get the customers payment method before programmatically creating a PaymentIntent or programmatically set the payment_method as the customers default source using a webhook?
We're using checkout for initial purchases of subscriptions, but we want to handle subscriptions on our side due to some complexities so will take future payments programatically
When creating a PaymentIntent, you need to pass the saved PaymentMethod Id and the Customer Id
I wanted to pass confirm=True which then automatically selects Customer.default_source as the payment method ๐
Ah ok I see, then you need to update the customer default_source manually when you get the PaymentMethod Id
thanks ๐