#hendr1x
1 messages · Page 1 of 1 (latest)
This is covered by the end of that doc, you can re-use that payment method ID after the PM has been saved https://stripe.com/docs/payments/save-during-payment?platform=web#charge-saved-payment-method
So each intent will only do one payment but you can use your saved payment methods on however many intents after the PM has been saved.
Thank you for your help.
Is there a command that tells the system to save the payment information or is it automatically done for all paymentIntents?
I think I found it
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yes exactly. And you can set that to either on_session, meaning you will only reuse it while the user is present on your website, or off_session meaning that you may charge the payment method automatically when the user is not around.
ok. Last question please...it seems like I need to both CUSTOMER_ID and PAYMENT_METHOD_ID. Where/how do I get PAYMENT_METHOD_ID?
A couple of ways. The Payment method ID will be set on the payment_method property of the intent when it is confirmed. So you can retrieve it there.
The successful payment will also trigger payment_intent.succeeded and payment_method.attached events that will have the ID in them.
Or you can list the saved payment methods for the customer with the API https://stripe.com/docs/api/payment_methods/list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.