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

remove charges and add balance

This commit is contained in:
Kyle Spearrin 2019-02-18 17:01:10 -05:00
parent 8b411de034
commit b95b35e7d9

View File

@ -2,16 +2,14 @@ import { PaymentMethodType } from '../../enums/paymentMethodType';
import { TransactionType } from '../../enums/transactionType';
export class BillingResponse {
balance: number;
paymentSource: BillingSourceResponse;
charges: BillingChargeResponse[] = [];
invoices: BillingInvoiceResponse[] = [];
transactions: BillingTransactionResponse[] = [];
constructor(response: any) {
this.balance = response.Balance;
this.paymentSource = response.PaymentSource == null ? null : new BillingSourceResponse(response.PaymentSource);
if (response.Charges != null) {
this.charges = response.Charges.map((c: any) => new BillingChargeResponse(c));
}
if (response.Transactions != null) {
this.transactions = response.Transactions.map((t: any) => new BillingTransactionResponse(t));
}
@ -35,30 +33,6 @@ export class BillingSourceResponse {
}
}
export class BillingChargeResponse {
createdDate: string;
amount: number;
paymentSource: BillingSourceResponse;
status: string;
failureMessage: string;
refunded: boolean;
partiallyRefunded: boolean;
refundedAmount: number;
invoiceId: string;
constructor(response: any) {
this.createdDate = response.CreatedDate;
this.amount = response.Amount;
this.paymentSource = response.PaymentSource != null ? new BillingSourceResponse(response.PaymentSource) : null;
this.status = response.Status;
this.failureMessage = response.FailureMessage;
this.refunded = response.Refunded;
this.partiallyRefunded = response.PartiallyRefunded;
this.refundedAmount = response.RefundedAmount;
this.invoiceId = response.InvoiceId;
}
}
export class BillingInvoiceResponse {
url: string;
pdfUrl: string;