1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

Combine tax info with other updates

This commit is contained in:
Chad Scharf
2020-06-17 20:11:30 -04:00
parent 4502a966a1
commit 68d3d7abfd
4 changed files with 10 additions and 7 deletions

View File

@@ -41,13 +41,20 @@ export class AdjustPaymentComponent {
async submit() {
try {
const request = new PaymentRequest();
await this.taxInfoComponent.submitTaxInfo();
this.formPromise = this.paymentComponent.createPaymentToken().then((result) => {
request.paymentToken = result[0];
request.paymentMethodType = result[1];
request.postalCode = this.taxInfoComponent.taxInfo.postalCode;
request.country = this.taxInfoComponent.taxInfo.country;
if (this.organizationId == null) {
return this.apiService.postAccountPayment(request);
} else {
request.taxId = this.taxInfoComponent.taxInfo.taxId;
request.state = this.taxInfoComponent.taxInfo.state;
request.line1 = this.taxInfoComponent.taxInfo.line1;
request.line2 = this.taxInfoComponent.taxInfo.line2;
request.city = this.taxInfoComponent.taxInfo.city;
request.state = this.taxInfoComponent.taxInfo.state;
return this.apiService.postOrganizationPayment(this.organizationId, request);
}
});