#redtopia-PaymentIntent
1 messages ยท Page 1 of 1 (latest)
Hi there, you can. Remember to set setup_future_usage to off_session in the first PaymentIntent so that the PaymentMethod used in this PaymentIntent will be attached to the customer for future usage.
yes, I am doing that
so I guess my question is, what API do I use to create the renewal charges?
@lost yew
I thought I would use either the paymentIntent api or the charges api to create subsequent charges, but I am not seeing the calls that I would make.
It's the same PaymentIntent creation API. you should pass the customer, paymentMethodId, and set confirm=true, off_session=true to make an off_session charge on your customer.
oh I see, so I create another paymentIntent object, and pass in the previous paymentIntentID for the paymentMethodID ?
No, you should pass the paymentMethodID, you can find it from the 1st PaymentIntent, or you can call the List a Customer's PaymentMethods API https://stripe.com/docs/api/payment_methods/customer_list?lang=curl#list_customer_payment_methods to get the list of PaymentMethods that are attached to a customer.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
oh, I see... so I set the payment_method to the ID of the payment method used in the original paymentIntent, and set off_session to true.
Other than using the orig paymentIntentID to get the customer's source, do I have to reference the original paymentIntentID anywhere when creating the subsequent paymentIntent objects?
No, you don't need to reference the previous PaymentIntent when creating a new PaymentIntent.
do I need to set setup_future_usage to off_session in the subsequent paymentIntent creations?
No need, you just need to set it in the first PaymentIntent.
ok... thanks
Will the payment be charged/captured automatically when I create the subsequent paymentIntent objects?
๐ stepping in for Jack
hi
It should be charged and capture immediately, if you pass confirm = true
ok.. and I can postpone the capture by setting it to false, and then calling the capture endpoint?
with off_session = true, Stripe automatically recognize the Payment Method was used in the first PaymentIntent and attempt to perform the charge with MIT exemption for you
I see
I believe it's also possible yes
You are welcomed! And good luck!