1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

dont send token when null

This commit is contained in:
Kyle Spearrin 2019-02-21 00:03:40 -05:00
parent 22727b5abe
commit cdfd828a8b
2 changed files with 4 additions and 2 deletions

View File

@ -79,7 +79,9 @@ export class PremiumComponent implements OnInit {
this.formPromise = this.paymentComponent.createPaymentToken().then((result) => { this.formPromise = this.paymentComponent.createPaymentToken().then((result) => {
const fd = new FormData(); const fd = new FormData();
fd.append('paymentMethodType', result[1].toString()); fd.append('paymentMethodType', result[1].toString());
if (result[0] != null) {
fd.append('paymentToken', result[0]); fd.append('paymentToken', result[0]);
}
fd.append('additionalStorageGb', (this.additionalStorage || 0).toString()); fd.append('additionalStorageGb', (this.additionalStorage || 0).toString());
return this.apiService.postPremium(fd); return this.apiService.postPremium(fd);
}).then(() => { }).then(() => {

View File

@ -9,7 +9,7 @@
<i class="fa fa-spinner fa-spin text-muted" *ngIf="!firstLoaded && loading" title="{{'loading' | i18n}}"></i> <i class="fa fa-spinner fa-spin text-muted" *ngIf="!firstLoaded && loading" title="{{'loading' | i18n}}"></i>
<ng-container *ngIf="billing"> <ng-container *ngIf="billing">
<h2>{{(isCreditBalance ? 'accountCredit' : 'accountBalance') | i18n}}</h2> <h2>{{(isCreditBalance ? 'accountCredit' : 'accountBalance') | i18n}}</h2>
<p><strong>{{creditOrBalance | currency:'$'}}</strong></p> <p class="text-lg"><strong>{{creditOrBalance | currency:'$'}}</strong></p>
<p>{{'creditAppliedDesc' | i18n}}</p> <p>{{'creditAppliedDesc' | i18n}}</p>
<button type="button" class="btn btn-outline-secondary" (click)="addCredit()" *ngIf="!showAddCredit"> <button type="button" class="btn btn-outline-secondary" (click)="addCredit()" *ngIf="!showAddCredit">
{{'addCredit' | i18n}} {{'addCredit' | i18n}}