#avia

1 messages · Page 1 of 1 (latest)

sage boltBOT
blazing cradle
#

Can you share an example sub_xxx?

clever dome
#

sub_1N1Nn2GDtsudHHOYQap1qhdE

blazing cradle
#

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

Create and manage subscriptions to accept recurring payments.

clever dome
#

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:

  1. stripe.Customer.create
  2. stripe.Subscription.create (with the customer id)
  3. stripe.PaymentIntent.create
    should I need to change the flow?
blazing cradle
#

The general flow is:

  • Customer creation
  • Subscription creation
  • Payment method collection
  • Payment confirmation (which starts the Subscription assuming successful)