From 13c8e260035ca1b6d2e6f222f5c9fabb6b64e3e4 Mon Sep 17 00:00:00 2001 From: Alex Morask <144709477+amorask-bitwarden@users.noreply.github.com> Date: Tue, 20 May 2025 09:15:01 -0400 Subject: [PATCH] Check FF before validating payment component (#14840) --- .../admin-console/providers/setup/setup.component.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bitwarden_license/bit-web/src/app/admin-console/providers/setup/setup.component.ts b/bitwarden_license/bit-web/src/app/admin-console/providers/setup/setup.component.ts index 695c57d1fe8..53b54e459ea 100644 --- a/bitwarden_license/bit-web/src/app/admin-console/providers/setup/setup.component.ts +++ b/bitwarden_license/bit-web/src/app/admin-console/providers/setup/setup.component.ts @@ -117,9 +117,15 @@ export class SetupComponent implements OnInit, OnDestroy { submit = async () => { try { + const requireProviderPaymentMethodDuringSetup = await firstValueFrom( + this.requireProviderPaymentMethodDuringSetup$, + ); + this.formGroup.markAllAsTouched(); - const paymentValid = this.paymentComponent.validate(); + const paymentValid = requireProviderPaymentMethodDuringSetup + ? this.paymentComponent.validate() + : true; const taxInformationValid = this.taxInformationComponent.validate(); if (!paymentValid || !taxInformationValid || !this.formGroup.valid) { @@ -146,10 +152,6 @@ export class SetupComponent implements OnInit, OnDestroy { request.taxInfo.city = taxInformation.city; request.taxInfo.state = taxInformation.state; - const requireProviderPaymentMethodDuringSetup = await firstValueFrom( - this.requireProviderPaymentMethodDuringSetup$, - ); - if (requireProviderPaymentMethodDuringSetup) { request.paymentSource = await this.paymentComponent.tokenize(); }