Fix mismatching stripe subscription metadata plan/planKey (#11634)
for later : https://github.com/twentyhq/core-team-issues/issues/867
This commit is contained in:
@ -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':
|
||||
|
||||
Reference in New Issue
Block a user