mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
Updated certain billing callsites to get billing history instead (#9443)
This commit is contained in:
@@ -4,26 +4,12 @@ import { PaymentMethodType, TransactionType } from "../../enums";
|
||||
export class BillingResponse extends BaseResponse {
|
||||
balance: number;
|
||||
paymentSource: BillingSourceResponse;
|
||||
invoices: BillingInvoiceResponse[] = [];
|
||||
transactions: BillingTransactionResponse[] = [];
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
this.balance = this.getResponseProperty("Balance");
|
||||
const paymentSource = this.getResponseProperty("PaymentSource");
|
||||
const transactions = this.getResponseProperty("Transactions");
|
||||
const invoices = this.getResponseProperty("Invoices");
|
||||
this.paymentSource = paymentSource == null ? null : new BillingSourceResponse(paymentSource);
|
||||
if (transactions != null) {
|
||||
this.transactions = transactions.map((t: any) => new BillingTransactionResponse(t));
|
||||
}
|
||||
if (invoices != null) {
|
||||
this.invoices = invoices.map((i: any) => new BillingInvoiceResponse(i));
|
||||
}
|
||||
}
|
||||
|
||||
get hasNoHistory() {
|
||||
return this.invoices.length == 0 && this.transactions.length == 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user