#kado-kaelan - Multiple Subscriptions

1 messages · Page 1 of 1 (latest)

rigid fulcrum
#

Hello! Yeah, what are the details?

sudden fractal
#

Alright, so, user signs up, stripe customer is created -> they chose their pricing plan (all include a week trial) -> insert card information and click submit which creates a stripe subscription and confirmCardSetup

#

so all of that works dandy

#

but if i type in an invalid card number itll still create the subscription then fail at confirmcardsetup

#

i create the subscription prior to confirmcardsetup because i need the clientSecret

rigid fulcrum
#

That sounds expected, with the Subscription's status being incomplete at that point, right?

sudden fractal
rigid fulcrum
#

Oh, okay, you're using trials, so trialing would be the status in that case.

sudden fractal
#

right so would i have to clear these out manually or is there a different flow i could use

rigid fulcrum
#

Why do you want to clear them out? I think I'm still missing some key information.

#

If you have a trial period and the trial is still active why would you want to clear them out?

sudden fractal
#

because that entry was created with an invalid card number

#

so once i enter a valid card number it will create another one under same email

rigid fulcrum
#

You don't let people update their existing trialing Subscriptions with the correct card info?

sudden fractal
#

This is all happening on same screen

rigid fulcrum
#

Setup Intents are intended to be reused until they succeed; the idea is that if the first payment info provided fails confirmation of the Setup Intent you get new info and attempt to confirm the same Setup Intent again.

sudden fractal
#

ah okay

#

so i need to check if they already have an active intent?

rigid fulcrum
#

What I would recommend is:

  1. Sign up button pressed
  2. Server creates a Subscription
  3. Subscription's client secret is passed to your frontend code
  4. Use Stripe.js to confirmCardSetup
  5. If that fails show an error and have them put in a new card number, then click sign up again
  6. Call confirmCardSetup again with the client secret you already have
sudden fractal
#

gotcha. Im goofing up by creating multiple subscriptions in the same session

#

if error need to use the same clientsecret