SirLan
SirLan
WWasp-lang
Created by uglybeanhead on 3/6/2024 in #đŸ™‹questions
I am trying to understand the subsciptionStatus logic in stripe.ts
57 replies
WWasp-lang
Created by uglybeanhead on 3/6/2024 in #đŸ™‹questions
I am trying to understand the subsciptionStatus logic in stripe.ts
Yeah for sure! I am AFK for a few hours but I will get one submitted as soon as I'm back đŸ˜€
57 replies
WWasp-lang
Created by uglybeanhead on 3/6/2024 in #đŸ™‹questions
I am trying to understand the subsciptionStatus logic in stripe.ts
Something like this fixes that
if (!context.user.credits && (!context.user.subscriptionStatus || context.user.subscriptionStatus === 'deleted' || context.user.subscriptionStatus === 'past_due')) {
throw new HttpError(402, 'User has not paid or is out of credits');
}
if (!context.user.credits && (!context.user.subscriptionStatus || context.user.subscriptionStatus === 'deleted' || context.user.subscriptionStatus === 'past_due')) {
throw new HttpError(402, 'User has not paid or is out of credits');
}
57 replies
WWasp-lang
Created by uglybeanhead on 3/6/2024 in #đŸ™‹questions
I am trying to understand the subsciptionStatus logic in stripe.ts
Just playing around at this point to see the functionality in the DemoApp. Love it, really nice work! I notice that you don't handle deleted/cancelled subscriptions in your generateGptResponse. So if a user has deleted or cancelled subscriptionStatus they can continue to use the API.
if (!context.user.subscriptionStatus && !context.user.credits) {
throw new HttpError(402, 'User has not paid or is out of credits');
}
if (!context.user.subscriptionStatus && !context.user.credits) {
throw new HttpError(402, 'User has not paid or is out of credits');
}
57 replies