#leonardo89 - metered subscription
1 messages · Page 1 of 1 (latest)
yes
here they just attach the created payment method to the customer, just that
That's an option yes. But what I would recommend instead is to first create the subscription on the backend, and then use the subscription.pending_setup_intent to collect payment information on the frontent.
https://stripe.com/docs/api/subscriptions/object#subscription_object-pending_setup_intent
ok so help me here,
first
1- create a customer
2- create a subscription with pending setup intent
and return to the client the client secret from subscription.pending_setup_intent
???
I dont understand, when i create the subscription the setup intent is created
yes, that's exactly it! so what is your question exactly?
1- create a customer
2- create a subscription with pending setup intent
3- return to the client the client secret from subscription.pending_setup_intent
My question is if I need to create a setupintent and add to subscription.pending_setup_intent field???
or is created automatically
??
No, the subscription automatically creates a SetupIntent for you in pending_setup_intent. Then you use the pending_setup_intent.client_secret on the frontend to collect the payment method.
mmm
and when the client confirms setup, all information is updated automatically??
I mean, the payment method is attached automatically, and the customer es updated whit the default payment method
??
and then the subscription object is updated automatically with this payment information??
Yes, everything should be done automatically for you once the SetupIntent is successful.
perfect thank you very much