#kado-kaelan - Multiple Subscriptions
1 messages · Page 1 of 1 (latest)
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
That sounds expected, with the Subscription's status being incomplete at that point, right?
Oh, okay, you're using trials, so trialing would be the status in that case.
right so would i have to clear these out manually or is there a different flow i could use
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?
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
You don't let people update their existing trialing Subscriptions with the correct card info?
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.
What I would recommend is:
- Sign up button pressed
- Server creates a Subscription
- Subscription's client secret is passed to your frontend code
- Use Stripe.js to
confirmCardSetup - If that fails show an error and have them put in a new card number, then click sign up again
- Call
confirmCardSetupagain with the client secret you already have