UNPKG

payrex-js-sdk

Version:
90 lines (85 loc) 3.4 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/billing-statement/dto.ts var dto_exports = {}; __export(dto_exports, { default: () => BillingStatementDto }); module.exports = __toCommonJS(dto_exports); // src/payment-intent/dto.ts var PaymentIntentDto = class { constructor(apiResponse) { this.id = apiResponse.id; this.resource = apiResponse.resource; this.amount = apiResponse.amount; this.amount_received = apiResponse.amount_received; this.amount_capturable = apiResponse.amount_capturable; this.client_secret = apiResponse.client_secret; this.currency = apiResponse.currency; this.description = apiResponse.description; this.livemode = apiResponse.livemode; this.metadata = apiResponse.metadata; this.next_action = apiResponse.next_action; this.payment_methods = apiResponse.payment_methods; this.payment_method_options = apiResponse.payment_method_options; this.statement_descriptor = apiResponse.statement_descriptor; this.status = apiResponse.status; this.created_at = apiResponse.created_at; this.updated_at = apiResponse.updated_at; } }; // src/statement-line-item/dto.ts var StatementLineItemDto = class { constructor(apiResponse) { this.id = apiResponse.id; this.resource = apiResponse.resource; this.description = apiResponse.description; this.unit_price = apiResponse.unit_price; this.quantity = apiResponse.quantity; this.billing_statement_id = apiResponse.billing_statement_id; this.livemode = apiResponse.livemode; this.created_at = apiResponse.created_at; this.updated_at = apiResponse.updated_at; } }; // src/billing-statement/dto.ts var BillingStatementDto = class { constructor(apiResponse) { this.id = apiResponse.id; this.resource = apiResponse.resource; this.amount = apiResponse.amount; this.currency = apiResponse.currency; this.customer_id = apiResponse.customer_id; this.description = apiResponse.description; this.status = apiResponse.status; this.line_items = apiResponse.line_items.map( (lineItem) => new StatementLineItemDto(lineItem) ); this.livemode = apiResponse.livemode; this.url = apiResponse.url; this.customer = apiResponse.customer; this.payment_intent = new PaymentIntentDto(apiResponse.payment_intent); this.metadata = apiResponse.metadata; this.payment_settings = apiResponse.payment_settings; this.billing_details_collection = apiResponse.billing_details_collection; this.due_at = apiResponse.due_at; this.created_at = apiResponse.created_at; this.updated_at = apiResponse.updated_at; } };