mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 01:03:35 +00:00
remove charges and add balance
This commit is contained in:
@@ -2,16 +2,14 @@ import { PaymentMethodType } from '../../enums/paymentMethodType';
|
|||||||
import { TransactionType } from '../../enums/transactionType';
|
import { TransactionType } from '../../enums/transactionType';
|
||||||
|
|
||||||
export class BillingResponse {
|
export class BillingResponse {
|
||||||
|
balance: number;
|
||||||
paymentSource: BillingSourceResponse;
|
paymentSource: BillingSourceResponse;
|
||||||
charges: BillingChargeResponse[] = [];
|
|
||||||
invoices: BillingInvoiceResponse[] = [];
|
invoices: BillingInvoiceResponse[] = [];
|
||||||
transactions: BillingTransactionResponse[] = [];
|
transactions: BillingTransactionResponse[] = [];
|
||||||
|
|
||||||
constructor(response: any) {
|
constructor(response: any) {
|
||||||
|
this.balance = response.Balance;
|
||||||
this.paymentSource = response.PaymentSource == null ? null : new BillingSourceResponse(response.PaymentSource);
|
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) {
|
if (response.Transactions != null) {
|
||||||
this.transactions = response.Transactions.map((t: any) => new BillingTransactionResponse(t));
|
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 {
|
export class BillingInvoiceResponse {
|
||||||
url: string;
|
url: string;
|
||||||
pdfUrl: string;
|
pdfUrl: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user