Fix mismatching stripe subscription metadata plan/planKey (#11634)

for later : https://github.com/twentyhq/core-team-issues/issues/867
This commit is contained in:
Etienne
2025-04-17 18:21:35 +02:00
committed by GitHub
parent e4150ff3cb
commit dd1ac4deee

View File

@ -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':