From bd2662620d760e653376afaed1c9901ff4f48290 Mon Sep 17 00:00:00 2001 From: Bereket Engida Date: Mon, 3 Mar 2025 15:56:23 +0300 Subject: [PATCH] fix(stripe): remove redundant error handling for existing subscriptions --- packages/stripe/src/index.ts | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/packages/stripe/src/index.ts b/packages/stripe/src/index.ts index 3b729918a9..0932221319 100644 --- a/packages/stripe/src/index.ts +++ b/packages/stripe/src/index.ts @@ -225,33 +225,6 @@ export const stripe = (options: O) => { }, }) .catch(async (e) => { - if (e.message.includes("no changes")) { - /** - * If the subscription is already active on stripe, we need to - * update the status to the new status. - */ - const plan = await getPlanByPriceId( - options, - activeSubscription.items.data[0]?.plan.id, - ); - await ctx.context.adapter.update({ - model: "subscription", - update: { - status: activeSubscription.status, - seats: activeSubscription.items.data[0]?.quantity, - plan: plan?.name.toLowerCase(), - }, - where: [ - { - field: "referenceId", - value: referenceId, - }, - ], - }); - throw new APIError("BAD_REQUEST", { - message: STRIPE_ERROR_CODES.ALREADY_SUBSCRIBED_PLAN, - }); - } throw ctx.error("BAD_REQUEST", { message: e.message, code: e.code,