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) => {
const fd = new FormData();
fd.append('paymentMethodType', result[1].toString());
fd.append('paymentToken', result[0]);
if (result[0] != null) {
fd.append('paymentToken', result[0]);
}
fd.append('additionalStorageGb', (this.additionalStorage || 0).toString());
return this.apiService.postPremium(fd);
}).then(() => {

View File

@ -9,7 +9,7 @@
<i class="fa fa-spinner fa-spin text-muted" *ngIf="!firstLoaded && loading" title="{{'loading' | i18n}}"></i>
<ng-container *ngIf="billing">
<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>
<button type="button" class="btn btn-outline-secondary" (click)="addCredit()" *ngIf="!showAddCredit">
{{'addCredit' | i18n}}