From cdfd828a8bdae692b22615893738f32e594fa3c2 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 21 Feb 2019 00:03:40 -0500 Subject: [PATCH] dont send token when null --- src/app/settings/premium.component.ts | 4 +++- src/app/settings/user-billing.component.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/settings/premium.component.ts b/src/app/settings/premium.component.ts index f94ec47632..9db7677694 100644 --- a/src/app/settings/premium.component.ts +++ b/src/app/settings/premium.component.ts @@ -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(() => { diff --git a/src/app/settings/user-billing.component.html b/src/app/settings/user-billing.component.html index 635d4e9ad3..e5dd6b6b45 100644 --- a/src/app/settings/user-billing.component.html +++ b/src/app/settings/user-billing.component.html @@ -9,7 +9,7 @@

{{(isCreditBalance ? 'accountCredit' : 'accountBalance') | i18n}}

-

{{creditOrBalance | currency:'$'}}

+

{{creditOrBalance | currency:'$'}}

{{'creditAppliedDesc' | i18n}}