1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 10:13:31 +00:00

Collect tax info for payments

This commit is contained in:
Chad Scharf
2020-06-12 19:33:29 -04:00
parent b1c098614c
commit 4bdb9c8632
15 changed files with 495 additions and 641 deletions

View File

@@ -17,6 +17,7 @@ import { TokenService } from 'jslib/abstractions/token.service';
import { UserService } from 'jslib/abstractions/user.service';
import { PaymentComponent } from './payment.component';
import { TaxInfoComponent } from './tax-info.component';
@Component({
selector: 'app-premium',
@@ -24,6 +25,7 @@ import { PaymentComponent } from './payment.component';
})
export class PremiumComponent implements OnInit {
@ViewChild(PaymentComponent) paymentComponent: PaymentComponent;
@ViewChild(TaxInfoComponent) taxInfoComponent: TaxInfoComponent;
canAccessPremium = false;
selfHosted = false;
@@ -76,6 +78,7 @@ export class PremiumComponent implements OnInit {
return this.finalizePremium();
});
} else {
await this.taxInfoComponent.submitTaxInfo();
this.formPromise = this.paymentComponent.createPaymentToken().then((result) => {
const fd = new FormData();
fd.append('paymentMethodType', result[1].toString());