#rohail-kamran_code
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/1445480746625011957
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
If the subscription is in trial, the status will be trialing: https://docs.stripe.com/api/subscriptions/object#subscription_object-status
https://docs.stripe.com/billing/subscriptions/overview#create-the-subscription:
you can create a trial that doesn’t require payments for the subscription. In that case, the status is trialing. When the trial is over, the subscription moves to active and the subscribed customer gets charged.
I'd recommend checking the status explanation here: https://docs.stripe.com/billing/subscriptions/overview#subscription-statuses
Oh okayyy. So I just change the code to this:
const isSubscriptionActive = (status === "active") || (status === "trialing");
Right?
If you're checking whether the subscription should provision the service, then this code looks right to me.
Here are the other status changes that we recommend to keep track of: https://docs.stripe.com/billing/subscriptions/webhooks#state-changes
Thank you for sharing this River! And for validating this.