From e3c75b3c1b4ec36c13b5fe2387ab1941eb6e56fb Mon Sep 17 00:00:00 2001 From: cyprain-okeke <108260115+cyprain-okeke@users.noreply.github.com> Date: Tue, 24 Sep 2024 18:07:29 +0100 Subject: [PATCH] Resolve the payment display (#11219) --- .../organizations/change-plan-dialog.component.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/web/src/app/billing/organizations/change-plan-dialog.component.ts b/apps/web/src/app/billing/organizations/change-plan-dialog.component.ts index 63ac3afb93..42a987664f 100644 --- a/apps/web/src/app/billing/organizations/change-plan-dialog.component.ts +++ b/apps/web/src/app/billing/organizations/change-plan-dialog.component.ts @@ -403,11 +403,13 @@ export class ChangePlanDialogComponent implements OnInit, OnDestroy { } get upgradeRequiresPaymentMethod() { - return ( - this.organization?.productTierType === ProductTierType.Free && - !this.showFree && - !this.billing?.paymentSource - ); + const isFreeTier = this.organization?.productTierType === ProductTierType.Free; + const shouldHideFree = !this.showFree; + const hasNoPaymentSource = this.deprecateStripeSourcesAPI + ? !this.paymentSource + : !this.billing?.paymentSource; + + return isFreeTier && shouldHideFree && hasNoPaymentSource; } get selectedSecretsManagerPlan() {