#geekcorner_subscription-duplicate
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1278035364573089947
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- geekcorner_best-practices, 1 day ago, 20 messages
- geekcorner_best-practices, 1 day ago, 5 messages
- geekcorner_paymentmethod-new, 3 days ago, 16 messages
Oh it's you again? I hope I don't bother you!
@woven pine I would recommend using a cookie/browser session to "remember" the person/customer. It's a bit similar to what you likely do if someone is "logged in" on your website and then reloads the page but you remember who they are.
Does that make sense?
geekcorner_subscription-duplicate
that may make sense indeed
but isn't there another foolproof method?
would save the subscription intent in the database work instead?
Ah sure I would definitely store all the information in my database. But you still need to map that Subscription/intent to the person browsing
i'd send the intent to my client when they fetch the intent endpoint shouldn't i?
Yes, but you were worried about someone reloading the page. When they reload you need to identify who it is and what they were doing before. But yes it's definitely a good idea to store the information in your database and then load it from it
i would save in the user actually
Hi there ๐ taking over, as my colleague needs to step away
When you say "user" what do you mean?
in my "user" account table
thinking about it but how would I make sure the subscription starts when the user confirms its payment method and not before? (using docs step 5)
We always recommend listening for the relevant webhooks (invoice.paid in this case is probably what you're looking for). This acts as the best source of truth when syncing your database and provisioning services
of course that's planned, but that doesn't really answer the question
is there a way to create the subscription as "pending" then start the 14 days trial period on demand (in this case once the user submits the subscription)?
Can you be more specific? Like, having a step-by-step explanation of what you're trying to do would be most helpful
- user picks a plan
- my backend creates a subscription (but puts it in a pending-like mode)
- user submits its payments details
- my backend tell stripe to start the subscription and 14 days trial
clear enough?
That's a pretty normal trial flow for Subscriptions. You would create the Subscription with a trial and then collect payment method details.
Here's some helpful info on trials: https://docs.stripe.com/billing/subscriptions/trials
The docs you posted are sufficient to create this flow, the only difference is you would add a trial period when you create the Subscription
i rather ask the payment details before starting the trial, similar to discord if that's possible
otherwise, would setupIntents be the way to go?
Ah, good point, sorry. Yes, you would need to use Setup Intents in place of Payment Intents here, which ensures you collect the payment method without charging it
okay, thanks!
Sure thing!