Skip to content

Commit

Permalink
resolve message for invalid message display
Browse files Browse the repository at this point in the history
  • Loading branch information
cyprain-okeke committed Jan 17, 2025
1 parent 5cacf76 commit f191c47
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {

submit = async () => {
if (this.taxComponent && !this.taxComponent.validate()) {
this.taxComponent.markAllAsTouched();
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export class PaymentV2Component implements OnInit, OnDestroy {
const clientSecret = await this.billingApiService.createSetupIntent(type);

if (this.usingBankAccount) {
this.formGroup.markAllAsTouched();
if (this.formGroup.valid) {
const token = await this.stripeService.setupBankAccountPaymentMethod(clientSecret, {
accountHolderName: this.formGroup.value.bankInformation.accountHolderName,
Expand Down Expand Up @@ -146,7 +147,11 @@ export class PaymentV2Component implements OnInit, OnDestroy {
};
}

throw new Error("Payment method not recognized or insufficient information provided.");
if (this.usingAccountCredit) {
throw "Invalid payment method";
}

return null;
}

ngOnDestroy(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ export class ManageTaxInformationComponent implements OnInit, OnDestroy {
}
}

markAllAsTouched() {
this.formGroup.markAllAsTouched();
}

async ngOnInit() {
if (this.startWith) {
this.formGroup.controls.country.setValue(this.startWith.country);
Expand Down

0 comments on commit f191c47

Please sign in to comment.