#bill_subscription-trial
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/1306753699653226590
๐ 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.
- bill92_webhooks, 2 days ago, 15 messages
create the stripe customer and subscription after the account has been verified (reposting for formatting)
// create stripe customer
const stripeCustomer = await stripe.customers.create({
email,
name
});
// create stripe subscription
const stripeSubscription = await stripe.subscriptions.create({
customer: stripeCustomer.id,
trial_period_days: 7,
trial_settings: { end_behavior: { missing_payment_method: 'cancel' } },
items: [{ price: priceMap[input.price], quantity: 1 }],
payment_behavior: 'default_incomplete',
});
Hello! Is missing_payment_method being set to cancel not giving you the behavior you want?
The customer.subscription.deleted event is triggered and the status of the subscription is changed to canceled, but this is when the trial is over (the 7 days have passed).
What if a customer signs up for the 7 day period and at day 2 he cancels the trial, I still want the user to have access to the product.
How are they canceling the trial?
technically, its cancelling the subscription on an active trial
No, what I mean is, how does your customer cancel it? Do they interact with a page on your site? Your app? Do they mail you a postcard? Do they use the Stripe Customer Portal? Do they go the library, move a particular book from one shelf to another, which in turn signals you to cancel it in the Dashboard? Do they call you on the phone?
an example would be me downloading an app on the iOS store, signing up and then cancelling the subscription on an active trial, usually I would still have access to the product..
oh I see
they would do that by themselves, they would interact with a page on my web platform
Okay, so since they're interacting with your website you have full control and can do whatever you want. You can immediately cancel the Stripe Subscription but flag in your own system that they have access until a certain date. You can leave the Stripe Subscription going, make sure it doesn't have a Payment Method, then let it cancel itself naturally when the trial ends. Lots of approaches, but it's entirely up to you.
Oh I see
I could try the following
- On my UI, add a "cancel trial" button
- Update the subscription with some
metadata? - DO NOT delete the subscription, only when the trial days are actually over
thoughts?
Sounds like a good place to start! Give it a try in test mode and see if it works the way you want/need it to. ๐
thanks for the pointers, have a great day
Happy to help!