1
0
mirror of https://github.com/bitwarden/web synced 2025-12-16 00:03:25 +00:00

handleCardPayment for incomplete payments

This commit is contained in:
Kyle Spearrin
2019-08-09 23:57:30 -04:00
parent 18608a8b63
commit a4571a2617
6 changed files with 68 additions and 25 deletions

View File

@@ -84,8 +84,13 @@ export class PremiumComponent implements OnInit {
}
fd.append('additionalStorageGb', (this.additionalStorage || 0).toString());
return this.apiService.postPremium(fd);
}).then(() => {
return this.finalizePremium();
}).then((paymentResponse) => {
if (!paymentResponse.success && paymentResponse.paymentIntentClientSecret != null) {
return this.paymentComponent.handleStripeCardPayment(paymentResponse.paymentIntentClientSecret,
() => this.finalizePremium());
} else {
return this.finalizePremium();
}
});
}
await this.formPromise;