#ilyeselb

1 messages · Page 1 of 1 (latest)

coarse relicBOT
lime blaze
#

Hey there

topaz slate
#

heyy

lime blaze
#

Can you provide me an example Subscription ID that I can look at?

topaz slate
#

okay

#

"sub_1NLn5YGyOBDbEOMCUM1L6de5"

#

this is on test mode

lime blaze
#

Thanks, taking a look

topaz slate
#

okay thank you

lime blaze
#

Okay so looks like you are using a SetupIntent to collect a PaymentMethod and then passing that PaymentMethod to the Subscription as the default_payment_method, correct?

topaz slate
#

yes

lime blaze
#

Are you anticipating starting these Subscriptions later on after collecting the payment method when your customer is no longer present on your website?

#

Or are you starting the Subsriptions immediately?

topaz slate
#

we are starting the subscription immediately after the payment

lime blaze
#

Okay gotcha

#

So in that case you don't want to use a SetupIntent here at all.

#

What you want to do instead is create the Subscription using payment_behavior: default_incomplete.

#

Then you pass the Invoice's PaymentIntent's client_secret to your frontend to use with PaymentElement and confirm that PaymentIntent.

#

That will both decrease the latency of your flow (less API requests) and handle 3DS whenver it is required for that initial payment.

#

The last thing you want to do is use payment_settings.save_default_payment_method

#

That will cause the PaymentMethod that is used to pay that initial Invoice/PaymentIntent to be set as the default for the Subscription

topaz slate
#

okay thank you, i will talk with the developer that coded that for us