From 684e5272d2438bc88bbe4af19412046403ea9b3b Mon Sep 17 00:00:00 2001 From: Lucas Smith Date: Thu, 7 Dec 2023 00:52:36 +0000 Subject: [PATCH] fix(webapp): use checkout for expired plans --- .../app/(dashboard)/settings/billing/create-checkout.action.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/(dashboard)/settings/billing/create-checkout.action.ts b/apps/web/src/app/(dashboard)/settings/billing/create-checkout.action.ts index 0552c55ec..465d662a1 100644 --- a/apps/web/src/app/(dashboard)/settings/billing/create-checkout.action.ts +++ b/apps/web/src/app/(dashboard)/settings/billing/create-checkout.action.ts @@ -23,7 +23,7 @@ export const createCheckout = async ({ priceId }: CreateCheckoutOptions) => { let stripeCustomer: Stripe.Customer | null = null; // Find the Stripe customer for the current user subscription. - if (existingSubscription) { + if (existingSubscription?.periodEnd && existingSubscription.periodEnd >= new Date()) { stripeCustomer = await getStripeCustomerById(existingSubscription.customerId); if (!stripeCustomer) {