payrex-js-sdk
Version:
A PayRex SDK written for NodeJS
74 lines (70 loc) • 2.88 kB
JavaScript
"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/checkout-session/dto.ts
var dto_exports = {};
__export(dto_exports, {
default: () => CheckoutSessionDto
});
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/checkout-session/dto.ts
var CheckoutSessionDto = class {
constructor(apiResponse) {
this.id = apiResponse.id;
this.resource = apiResponse.resource;
this.customer_reference_id = apiResponse.customer_reference_id;
this.client_secret = apiResponse.client_secret;
this.status = apiResponse.status;
this.currency = apiResponse.currency;
this.line_items = apiResponse.line_items;
this.livemode = apiResponse.livemode;
this.url = apiResponse.url;
this.payment_intent = new PaymentIntentDto(apiResponse.payment_intent);
this.metadata = apiResponse.metadata;
this.success_url = apiResponse.success_url;
this.cancel_url = apiResponse.cancel_url;
this.payment_methods = apiResponse.payment_methods;
this.description = apiResponse.description;
this.submit_type = apiResponse.submit_type;
this.expires_at = apiResponse.expires_at;
this.created_at = apiResponse.created_at;
this.updated_at = apiResponse.updated_at;
}
};