From b95b35e7d9444c668691dd3ee6e78c1904321f22 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 18 Feb 2019 17:01:10 -0500 Subject: [PATCH] remove charges and add balance --- src/models/response/billingResponse.ts | 30 ++------------------------ 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/src/models/response/billingResponse.ts b/src/models/response/billingResponse.ts index 48c797f3f6b..c1c605c435f 100644 --- a/src/models/response/billingResponse.ts +++ b/src/models/response/billingResponse.ts @@ -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;