#avia
1 messages · Page 1 of 1 (latest)
Can you share an example sub_xxx?
sub_1N1Nn2GDtsudHHOYQap1qhdE
Well, the Customer (https://dashboard.stripe.com/test/customers/cus_Nmxip4az8BBsts) passed on Subscription creation doesn't have a invoice_settings.default_payment_method set so we can't automatically start the Subscription. The Payment Intent associated with the initial Invoice is awaiting confirmation to actually collect payment and start the Subscription. You should do this as part of your flow whilst Customer is on-session: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#collect-payment
you're right, when I create a new customer I don't have the payment . the payment comes after that. so how to do this?
On the server side, the flow is:
- stripe.Customer.create
- stripe.Subscription.create (with the customer id)
- stripe.PaymentIntent.create
should I need to change the flow?
Why are you creating a separate Payment Intent? The Subscription creation handles that for you. I'd recommend reading and following the guide: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
The general flow is:
- Customer creation
- Subscription creation
- Payment method collection
- Payment confirmation (which starts the Subscription assuming successful)