#pavan-subscriptions

1 messages · Page 1 of 1 (latest)

indigo sky
#

@hardy quiver I don't really understand what you mean, since SetupIntents don't complete payments, they're for saving a payment method to the customer, not sure where you are bringing them in here.

#

the way it works with subscriptions if you create the Subscription, the first invoice has a PaymentIntent with a client_secret, as you said, and then you confirm that PaymentIntent on the frontend using Elements, which a)charges the card b) pays the invoice) c) attaches the payment method to the customer, all at once. No SetupIntent involved.

hardy quiver
#

Update Subscription: 1. Collect quantities to update from frontend 2. Update subscription params in backend. 3. If payment details has to be updated then setupIntent is required to update payment. Similarly in creation flow to update payment method can i use setupIntent ?

indigo sky
#

if you're creating the subscription then you don't need to update the payment method, like I said, you use the Invoice's PaymentIntent with confirmCardPayment+Elements, it attaches the card to the customer. No SetupIntent involved.

hardy quiver
#

That i agree. Is there any issue if i involve setupintent in that which attaches card to customer ?

indigo sky
#

there's no reason to use a SetupIntent here

hardy quiver
#

If we use paymentIntent and complete payment step from frontend, will that card by default will be taken for deducting amount in recurring transaction ? Or should we update as default payment in webhooks ?

indigo sky
#

Or should we update as default payment in webhooks ?
yep you have to do that.

#

(that's the guide you should be following in general)

hardy quiver
#

If we do this via SetupIntent, do we still need to do that ?

indigo sky
#

you would yes, Setup/PaymentIntents only attach the card, marking it as the default always has to be done separately

hardy quiver
#

Hey what does setupIntent do in the background ?