From dd1ac4deee16a72bd8297c5b7c10511152bd9577 Mon Sep 17 00:00:00 2001 From: Etienne <45695613+etiennejouan@users.noreply.github.com> Date: Thu, 17 Apr 2025 18:21:35 +0200 Subject: [PATCH] Fix mismatching stripe subscription metadata plan/planKey (#11634) for later : https://github.com/twentyhq/core-team-issues/issues/867 --- .../billing/utils/get-plan-key-from-subscription.util.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/twenty-server/src/engine/core-modules/billing/utils/get-plan-key-from-subscription.util.ts b/packages/twenty-server/src/engine/core-modules/billing/utils/get-plan-key-from-subscription.util.ts index cf26b8433..cbeffe082 100644 --- a/packages/twenty-server/src/engine/core-modules/billing/utils/get-plan-key-from-subscription.util.ts +++ b/packages/twenty-server/src/engine/core-modules/billing/utils/get-plan-key-from-subscription.util.ts @@ -4,9 +4,9 @@ import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-pl export const getPlanKeyFromSubscription = ( subscription: BillingSubscription, ): BillingPlanKey => { - const planKey = subscription.metadata?.planKey; + const plan = subscription.metadata?.plan; //To do : #867 Naming issue decide if we should rename stripe product metadata planKey to plan (+ productKey to product) OR at session checkout creating subscription with metadata planKey (and not plan) - switch (planKey) { + switch (plan) { case 'PRO': return BillingPlanKey.PRO; case 'ENTERPRISE':