account credit/balance

This commit is contained in:
Kyle Spearrin 2019-02-18 17:34:57 -05:00
parent 8305b49046
commit e45c988637
4 changed files with 24 additions and 2 deletions

2
jslib

@ -1 +1 @@
Subproject commit 8b411de034569b36788239a5948d64f5029d6437
Subproject commit b95b35e7d9444c668691dd3ee6e78c1904321f22

View File

@ -8,7 +8,9 @@
</div>
<i class="fa fa-spinner fa-spin text-muted" *ngIf="!firstLoaded && loading" title="{{'loading' | i18n}}"></i>
<ng-container *ngIf="billing">
<h2>{{'paymentMethod' | i18n}}</h2>
<h2>{{(isCreditBalance ? 'accountCredit' : 'accountBalance') | i18n}}</h2>
<p>{{creditOrBalance | currency:'$'}}</p>
<h2 class="spaced-header">{{'paymentMethod' | i18n}}</h2>
<p *ngIf="!paymentSource">{{'noPaymentMethod' | i18n}}</p>
<ng-container *ngIf="paymentSource">
<app-callout type="warning" title="{{'verifyBankAccount' | i18n}}"

View File

@ -81,6 +81,14 @@ export class UserBillingComponent implements OnInit {
}
}
get isCreditBalance() {
return this.billing == null || this.billing.balance <= 0;
}
get creditOrBalance() {
return Math.abs(this.billing != null ? this.billing.balance : 0);
}
get paymentSource() {
return this.billing != null ? this.billing.paymentSource : null;
}

View File

@ -1490,6 +1490,18 @@
"billing": {
"message": "Billing"
},
"accountCredit": {
"message": "Account Credit",
"description": "Financial term. In the case of Bitwarden, a positive balance means that you owe money, while a negative balance means that you have a credit (Bitwarden owes you money)."
},
"accountBalance": {
"message": "Account Balance",
"description": "Financial term. In the case of Bitwarden, a positive balance means that you owe money, while a negative balance means that you have a credit (Bitwarden owes you money)."
},
"addCredit": {
"message": "Add Credit",
"description": "Add more credit to your account's balance."
},
"goPremium": {
"message": "Go Premium",
"description": "Another way of saying \"Get a premium membership\""