#redtopia-PaymentIntent

1 messages ยท Page 1 of 1 (latest)

lost yew
#

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.

ashen charm
#

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.

lost yew
#

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.

ashen charm
#

oh I see, so I create another paymentIntent object, and pass in the previous paymentIntentID for the paymentMethodID ?

lost yew
#

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.

ashen charm
#

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?

lost yew
#

No, you don't need to reference the previous PaymentIntent when creating a new PaymentIntent.

ashen charm
#

do I need to set setup_future_usage to off_session in the subsequent paymentIntent creations?

lost yew
#

No need, you just need to set it in the first PaymentIntent.

ashen charm
#

ok... thanks

Will the payment be charged/captured automatically when I create the subsequent paymentIntent objects?

undone moon
#

๐Ÿ‘‹ stepping in for Jack

ashen charm
#

hi

undone moon
#

It should be charged and capture immediately, if you pass confirm = true

ashen charm
#

ok.. and I can postpone the capture by setting it to false, and then calling the capture endpoint?

undone moon
#

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

ashen charm
#

I see

undone moon
#

I believe it's also possible yes

ashen charm
#

ok thank you... this helps a lot.

#

you guys are great!! ๐Ÿ™‚

undone moon
#

You are welcomed! And good luck!