UNPKG

fake-iamport-server

Version:
553 lines (552 loc) 209 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.FakeIamportPaymentsController = void 0; var __nestia_core_transform_isTypeUint32 = __importStar(require("typia/lib/internal/_isTypeUint32.js")); var __nestia_core_transform_isFormatUri = __importStar(require("typia/lib/internal/_isFormatUri.js")); var __nestia_core_transform_isFormatEmail = __importStar(require("typia/lib/internal/_isFormatEmail.js")); var __nestia_core_transform_assertGuard = __importStar(require("typia/lib/internal/_assertGuard.js")); var __nestia_core_transform_jsonStringifyString = __importStar(require("typia/lib/internal/_jsonStringifyString.js")); var __nestia_core_transform_throwTypeGuardError = __importStar(require("typia/lib/internal/_throwTypeGuardError.js")); var __nestia_core_transform_httpParameterReadString = __importStar(require("typia/lib/internal/_httpParameterReadString.js")); var __nestia_core_transform_httpQueryParseURLSearchParams = __importStar(require("typia/lib/internal/_httpQueryParseURLSearchParams.js")); var __nestia_core_transform_httpQueryReadBoolean = __importStar(require("typia/lib/internal/_httpQueryReadBoolean.js")); var __nestia_core_transform_validateReport = __importStar(require("typia/lib/internal/_validateReport.js")); var core_1 = __importDefault(require("@nestia/core")); var common_1 = require("@nestjs/common"); var FakeIamportUserAuth_1 = require("../decorators/FakeIamportUserAuth"); var FakeIamportPaymentProvider_1 = require("../providers/FakeIamportPaymentProvider"); var FakeIamportResponseProvider_1 = require("../providers/FakeIamportResponseProvider"); var FakeIamportStorage_1 = require("../providers/FakeIamportStorage"); var FakeIamportPaymentsController = /** @class */ (function () { function FakeIamportPaymentsController() { } /** * 결제 기록 열람하기. * * 아임포트를 통하여 발생한 결제 기록을 열람한다. * * @param imp_uid 대상 결제 기록의 {@link IIamportPayment.imp_uid} * @param query 결제 수단이 페이팔인 경우에 사용 * @returns 결제 정보 * * @security bearer * @author Samchon */ FakeIamportPaymentsController.prototype.at = function (_user, imp_uid, query) { query; var payment = FakeIamportStorage_1.FakeIamportStorage.payments.get(imp_uid); return FakeIamportResponseProvider_1.FakeIamportResponseProvider.success(payment); }; /** * 결제 취소하기. * * 만약 가상 계좌를 통한 결제였다면, 반드시 환불 계좌 정보를 입력해줘야 한다. * * @param input 결제 취소 입력 정보 * @returns 취소된 결제 정보 * * @security bearer * @author Samchon */ FakeIamportPaymentsController.prototype.cancel = function (_user, input) { var payment = FakeIamportStorage_1.FakeIamportStorage.payments.get(input.imp_uid); FakeIamportPaymentProvider_1.FakeIamportPaymentProvider.cancel(payment, input); return FakeIamportResponseProvider_1.FakeIamportResponseProvider.success(payment); }; __decorate([ core_1.default.TypedRoute.Get(":imp_uid", { type: "assert", assert: (function () { var _iv4 = new Set(["phone", "kpay", "kakaopay", "payco", "lpay", "ssgpay", "tosspay", "cultureland", "smartculture", "happymoney", "booknlife", "point"]); var _iv6 = new Set(["phone", "kpay", "kakaopay", "payco", "lpay", "ssgpay", "tosspay", "cultureland", "smartculture", "happymoney", "booknlife", "point"]); var _av10 = new Set(["phone", "kpay", "kakaopay", "payco", "lpay", "ssgpay", "tosspay", "cultureland", "smartculture", "happymoney", "booknlife", "point"]); var _av12 = new Set(["phone", "kpay", "kakaopay", "payco", "lpay", "ssgpay", "tosspay", "cultureland", "smartculture", "happymoney", "booknlife", "point"]); var _iv17 = new Set(["phone", "kpay", "kakaopay", "payco", "lpay", "ssgpay", "tosspay", "cultureland", "smartculture", "happymoney", "booknlife", "point"]); var _io0 = function (input) { return "number" === typeof input.code && !Number.isNaN(input.code) && "string" === typeof input.message && ("object" === typeof input.response && null !== input.response && _iu0(input.response)); }; var _io1 = function (input) { return "string" === typeof input.card_code && "string" === typeof input.card_name && ("string" === typeof input.card_number && RegExp("\\d{4}-\\d{4}-\\d{4}-\\d{4}").test(input.card_number)) && ("number" === typeof input.card_quota && __nestia_core_transform_isTypeUint32._isTypeUint32(input.card_quota)) && "string" === typeof input.apply_num && ("card" === input.pay_method || "samsung" === input.pay_method) && "string" === typeof input.imp_uid && "string" === typeof input.merchant_uid && (null === input.name || "string" === typeof input.name) && ("number" === typeof input.amount && !Number.isNaN(input.amount)) && ("number" === typeof input.cancel_amount && !Number.isNaN(input.cancel_amount)) && ("KRW" === input.currency || "USD" === input.currency || "EUR" === input.currency || "JPY" === input.currency) && ("string" === typeof input.receipt_url && __nestia_core_transform_isFormatUri._isFormatUri(input.receipt_url)) && "boolean" === typeof input.cash_receipt_issue && "string" === typeof input.channel && "string" === typeof input.pg_provider && (null === input.emb_pg_provider || "string" === typeof input.emb_pg_provider) && "string" === typeof input.pg_id && "string" === typeof input.pg_tid && "boolean" === typeof input.escrow && (null === input.buyer_name || "string" === typeof input.buyer_name) && (null === input.buyer_email || "string" === typeof input.buyer_email && __nestia_core_transform_isFormatEmail._isFormatEmail(input.buyer_email)) && (null === input.buyer_tel || "string" === typeof input.buyer_tel) && (null === input.buyer_addr || "string" === typeof input.buyer_addr) && (null === input.buyer_postcode || "string" === typeof input.buyer_postcode) && (null === input.customer_uid || "string" === typeof input.customer_uid) && (null === input.customer_uid_usage || "string" === typeof input.customer_uid_usage) && (null === input.custom_data || "string" === typeof input.custom_data) && (null === input.user_agent || "string" === typeof input.user_agent) && ("paid" === input.status || "ready" === input.status || "failed" === input.status || "cancelled" === input.status) && ("number" === typeof input.started_at && !Number.isNaN(input.started_at)) && ("number" === typeof input.paid_at && !Number.isNaN(input.paid_at)) && ("number" === typeof input.failed_at && !Number.isNaN(input.failed_at)) && ("number" === typeof input.cancelled_at && !Number.isNaN(input.cancelled_at)) && (null === input.fail_reason || "string" === typeof input.fail_reason) && (null === input.cancel_reason || "string" === typeof input.cancel_reason) && (Array.isArray(input.cancel_history) && input.cancel_history.every(function (elem) { return "object" === typeof elem && null !== elem && _io2(elem); })); }; var _io2 = function (input) { return "string" === typeof input.pg_id && "string" === typeof input.pg_tid && ("number" === typeof input.amount && !Number.isNaN(input.amount)) && ("number" === typeof input.cancelled_at && !Number.isNaN(input.cancelled_at)) && "string" === typeof input.reason && ("string" === typeof input.receipt_url && __nestia_core_transform_isFormatUri._isFormatUri(input.receipt_url)); }; var _io3 = function (input) { return "string" === typeof input.bank_code && "string" === typeof input.bank_name && "trans" === input.pay_method && "string" === typeof input.imp_uid && "string" === typeof input.merchant_uid && (null === input.name || "string" === typeof input.name) && ("number" === typeof input.amount && !Number.isNaN(input.amount)) && ("number" === typeof input.cancel_amount && !Number.isNaN(input.cancel_amount)) && ("KRW" === input.currency || "USD" === input.currency || "EUR" === input.currency || "JPY" === input.currency) && ("string" === typeof input.receipt_url && __nestia_core_transform_isFormatUri._isFormatUri(input.receipt_url)) && "boolean" === typeof input.cash_receipt_issue && "string" === typeof input.channel && "string" === typeof input.pg_provider && (null === input.emb_pg_provider || "string" === typeof input.emb_pg_provider) && "string" === typeof input.pg_id && "string" === typeof input.pg_tid && "boolean" === typeof input.escrow && (null === input.buyer_name || "string" === typeof input.buyer_name) && (null === input.buyer_email || "string" === typeof input.buyer_email && __nestia_core_transform_isFormatEmail._isFormatEmail(input.buyer_email)) && (null === input.buyer_tel || "string" === typeof input.buyer_tel) && (null === input.buyer_addr || "string" === typeof input.buyer_addr) && (null === input.buyer_postcode || "string" === typeof input.buyer_postcode) && (null === input.customer_uid || "string" === typeof input.customer_uid) && (null === input.customer_uid_usage || "string" === typeof input.customer_uid_usage) && (null === input.custom_data || "string" === typeof input.custom_data) && (null === input.user_agent || "string" === typeof input.user_agent) && ("paid" === input.status || "ready" === input.status || "failed" === input.status || "cancelled" === input.status) && ("number" === typeof input.started_at && !Number.isNaN(input.started_at)) && ("number" === typeof input.paid_at && !Number.isNaN(input.paid_at)) && ("number" === typeof input.failed_at && !Number.isNaN(input.failed_at)) && ("number" === typeof input.cancelled_at && !Number.isNaN(input.cancelled_at)) && (null === input.fail_reason || "string" === typeof input.fail_reason) && (null === input.cancel_reason || "string" === typeof input.cancel_reason) && (Array.isArray(input.cancel_history) && input.cancel_history.every(function (elem) { return "object" === typeof elem && null !== elem && _io2(elem); })); }; var _io4 = function (input) { return "string" === typeof input.vbank_code && "string" === typeof input.vbank_name && "string" === typeof input.vbank_num && "string" === typeof input.vbank_holder && ("number" === typeof input.vbank_date && !Number.isNaN(input.vbank_date)) && ("number" === typeof input.vbank_issued_at && !Number.isNaN(input.vbank_issued_at)) && "vbank" === input.pay_method && "string" === typeof input.imp_uid && "string" === typeof input.merchant_uid && (null === input.name || "string" === typeof input.name) && ("number" === typeof input.amount && !Number.isNaN(input.amount)) && ("number" === typeof input.cancel_amount && !Number.isNaN(input.cancel_amount)) && ("KRW" === input.currency || "USD" === input.currency || "EUR" === input.currency || "JPY" === input.currency) && ("string" === typeof input.receipt_url && __nestia_core_transform_isFormatUri._isFormatUri(input.receipt_url)) && "boolean" === typeof input.cash_receipt_issue && "string" === typeof input.channel && "string" === typeof input.pg_provider && (null === input.emb_pg_provider || "string" === typeof input.emb_pg_provider) && "string" === typeof input.pg_id && "string" === typeof input.pg_tid && "boolean" === typeof input.escrow && (null === input.buyer_name || "string" === typeof input.buyer_name) && (null === input.buyer_email || "string" === typeof input.buyer_email && __nestia_core_transform_isFormatEmail._isFormatEmail(input.buyer_email)) && (null === input.buyer_tel || "string" === typeof input.buyer_tel) && (null === input.buyer_addr || "string" === typeof input.buyer_addr) && (null === input.buyer_postcode || "string" === typeof input.buyer_postcode) && (null === input.customer_uid || "string" === typeof input.customer_uid) && (null === input.customer_uid_usage || "string" === typeof input.customer_uid_usage) && (null === input.custom_data || "string" === typeof input.custom_data) && (null === input.user_agent || "string" === typeof input.user_agent) && ("paid" === input.status || "ready" === input.status || "failed" === input.status || "cancelled" === input.status) && ("number" === typeof input.started_at && !Number.isNaN(input.started_at)) && ("number" === typeof input.paid_at && !Number.isNaN(input.paid_at)) && ("number" === typeof input.failed_at && !Number.isNaN(input.failed_at)) && ("number" === typeof input.cancelled_at && !Number.isNaN(input.cancelled_at)) && (null === input.fail_reason || "string" === typeof input.fail_reason) && (null === input.cancel_reason || "string" === typeof input.cancel_reason) && (Array.isArray(input.cancel_history) && input.cancel_history.every(function (elem) { return "object" === typeof elem && null !== elem && _io2(elem); })); }; var _io5 = function (input) { return true === _iv4.has(input.pay_method) && "string" === typeof input.imp_uid && "string" === typeof input.merchant_uid && (null === input.name || "string" === typeof input.name) && ("number" === typeof input.amount && !Number.isNaN(input.amount)) && ("number" === typeof input.cancel_amount && !Number.isNaN(input.cancel_amount)) && ("KRW" === input.currency || "USD" === input.currency || "EUR" === input.currency || "JPY" === input.currency) && ("string" === typeof input.receipt_url && __nestia_core_transform_isFormatUri._isFormatUri(input.receipt_url)) && "boolean" === typeof input.cash_receipt_issue && "string" === typeof input.channel && "string" === typeof input.pg_provider && (null === input.emb_pg_provider || "string" === typeof input.emb_pg_provider) && "string" === typeof input.pg_id && "string" === typeof input.pg_tid && "boolean" === typeof input.escrow && (null === input.buyer_name || "string" === typeof input.buyer_name) && (null === input.buyer_email || "string" === typeof input.buyer_email && __nestia_core_transform_isFormatEmail._isFormatEmail(input.buyer_email)) && (null === input.buyer_tel || "string" === typeof input.buyer_tel) && (null === input.buyer_addr || "string" === typeof input.buyer_addr) && (null === input.buyer_postcode || "string" === typeof input.buyer_postcode) && (null === input.customer_uid || "string" === typeof input.customer_uid) && (null === input.customer_uid_usage || "string" === typeof input.customer_uid_usage) && (null === input.custom_data || "string" === typeof input.custom_data) && (null === input.user_agent || "string" === typeof input.user_agent) && ("paid" === input.status || "ready" === input.status || "failed" === input.status || "cancelled" === input.status) && ("number" === typeof input.started_at && !Number.isNaN(input.started_at)) && ("number" === typeof input.paid_at && !Number.isNaN(input.paid_at)) && ("number" === typeof input.failed_at && !Number.isNaN(input.failed_at)) && ("number" === typeof input.cancelled_at && !Number.isNaN(input.cancelled_at)) && (null === input.fail_reason || "string" === typeof input.fail_reason) && (null === input.cancel_reason || "string" === typeof input.cancel_reason) && (Array.isArray(input.cancel_history) && input.cancel_history.every(function (elem) { return "object" === typeof elem && null !== elem && _io2(elem); })); }; var _iu0 = function (input) { return (function () { if ("card" === input.pay_method || "samsung" === input.pay_method) return _io1(input); else if ("trans" === input.pay_method) return _io3(input); else if ("vbank" === input.pay_method) return _io4(input); else if (true === _iv6.has(input.pay_method)) return _io5(input); else return false; })(); }; var _ao0 = function (input, _path, _exceptionable) { if (_exceptionable === void 0) { _exceptionable = true; } return ("number" === typeof input.code && !Number.isNaN(input.code) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".code", expected: "number", value: input.code }, _errorFactory)) && ("string" === typeof input.message || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".message", expected: "string", value: input.message }, _errorFactory)) && (("object" === typeof input.response && null !== input.response || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".response", expected: "(IIamportCardPayment | IIamportPayment.IBase<\"phone\" | \"kpay\" | \"kakaopay\" | \"payco\" | \"lpay\" | \"ssgpay\" | \"tosspay\" | \"cultureland\" | \"smartculture\" | \"happymoney\" | \"booknlife\" | \"point\"> | IIamportTransferPayment | IIamportVBankPayment)", value: input.response }, _errorFactory)) && _au0(input.response, _path + ".response", true && _exceptionable) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".response", expected: "(IIamportCardPayment | IIamportPayment.IBase<\"phone\" | \"kpay\" | \"kakaopay\" | \"payco\" | \"lpay\" | \"ssgpay\" | \"tosspay\" | \"cultureland\" | \"smartculture\" | \"happymoney\" | \"booknlife\" | \"point\"> | IIamportTransferPayment | IIamportVBankPayment)", value: input.response }, _errorFactory)); }; var _ao1 = function (input, _path, _exceptionable) { if (_exceptionable === void 0) { _exceptionable = true; } return ("string" === typeof input.card_code || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".card_code", expected: "string", value: input.card_code }, _errorFactory)) && ("string" === typeof input.card_name || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".card_name", expected: "string", value: input.card_name }, _errorFactory)) && ("string" === typeof input.card_number && (RegExp("\\d{4}-\\d{4}-\\d{4}-\\d{4}").test(input.card_number) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".card_number", expected: "string & Pattern<\"\\\\d{4}-\\\\d{4}-\\\\d{4}-\\\\d{4}\">", value: input.card_number }, _errorFactory)) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".card_number", expected: "(string & Pattern<\"\\\\d{4}-\\\\d{4}-\\\\d{4}-\\\\d{4}\">)", value: input.card_number }, _errorFactory)) && ("number" === typeof input.card_quota && (__nestia_core_transform_isTypeUint32._isTypeUint32(input.card_quota) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".card_quota", expected: "number & Type<\"uint32\">", value: input.card_quota }, _errorFactory)) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".card_quota", expected: "(number & Type<\"uint32\">)", value: input.card_quota }, _errorFactory)) && ("string" === typeof input.apply_num || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".apply_num", expected: "string", value: input.apply_num }, _errorFactory)) && ("card" === input.pay_method || "samsung" === input.pay_method || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".pay_method", expected: "(\"card\" | \"samsung\")", value: input.pay_method }, _errorFactory)) && ("string" === typeof input.imp_uid || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".imp_uid", expected: "string", value: input.imp_uid }, _errorFactory)) && ("string" === typeof input.merchant_uid || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".merchant_uid", expected: "string", value: input.merchant_uid }, _errorFactory)) && (null === input.name || "string" === typeof input.name || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".name", expected: "(null | string)", value: input.name }, _errorFactory)) && ("number" === typeof input.amount && !Number.isNaN(input.amount) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".amount", expected: "number", value: input.amount }, _errorFactory)) && ("number" === typeof input.cancel_amount && !Number.isNaN(input.cancel_amount) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".cancel_amount", expected: "number", value: input.cancel_amount }, _errorFactory)) && ("KRW" === input.currency || "USD" === input.currency || "EUR" === input.currency || "JPY" === input.currency || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".currency", expected: "(\"EUR\" | \"JPY\" | \"KRW\" | \"USD\")", value: input.currency }, _errorFactory)) && ("string" === typeof input.receipt_url && (__nestia_core_transform_isFormatUri._isFormatUri(input.receipt_url) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".receipt_url", expected: "string & Format<\"uri\">", value: input.receipt_url }, _errorFactory)) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".receipt_url", expected: "(string & Format<\"uri\">)", value: input.receipt_url }, _errorFactory)) && ("boolean" === typeof input.cash_receipt_issue || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".cash_receipt_issue", expected: "boolean", value: input.cash_receipt_issue }, _errorFactory)) && ("string" === typeof input.channel || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".channel", expected: "string", value: input.channel }, _errorFactory)) && ("string" === typeof input.pg_provider || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".pg_provider", expected: "string", value: input.pg_provider }, _errorFactory)) && (null === input.emb_pg_provider || "string" === typeof input.emb_pg_provider || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".emb_pg_provider", expected: "(null | string)", value: input.emb_pg_provider }, _errorFactory)) && ("string" === typeof input.pg_id || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".pg_id", expected: "string", value: input.pg_id }, _errorFactory)) && ("string" === typeof input.pg_tid || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".pg_tid", expected: "string", value: input.pg_tid }, _errorFactory)) && ("boolean" === typeof input.escrow || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".escrow", expected: "boolean", value: input.escrow }, _errorFactory)) && (null === input.buyer_name || "string" === typeof input.buyer_name || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".buyer_name", expected: "(null | string)", value: input.buyer_name }, _errorFactory)) && (null === input.buyer_email || "string" === typeof input.buyer_email && (__nestia_core_transform_isFormatEmail._isFormatEmail(input.buyer_email) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".buyer_email", expected: "string & Format<\"email\">", value: input.buyer_email }, _errorFactory)) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".buyer_email", expected: "((string & Format<\"email\">) | null)", value: input.buyer_email }, _errorFactory)) && (null === input.buyer_tel || "string" === typeof input.buyer_tel || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".buyer_tel", expected: "(null | string)", value: input.buyer_tel }, _errorFactory)) && (null === input.buyer_addr || "string" === typeof input.buyer_addr || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".buyer_addr", expected: "(null | string)", value: input.buyer_addr }, _errorFactory)) && (null === input.buyer_postcode || "string" === typeof input.buyer_postcode || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".buyer_postcode", expected: "(null | string)", value: input.buyer_postcode }, _errorFactory)) && (null === input.customer_uid || "string" === typeof input.customer_uid || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".customer_uid", expected: "(null | string)", value: input.customer_uid }, _errorFactory)) && (null === input.customer_uid_usage || "string" === typeof input.customer_uid_usage || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".customer_uid_usage", expected: "(null | string)", value: input.customer_uid_usage }, _errorFactory)) && (null === input.custom_data || "string" === typeof input.custom_data || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".custom_data", expected: "(null | string)", value: input.custom_data }, _errorFactory)) && (null === input.user_agent || "string" === typeof input.user_agent || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".user_agent", expected: "(null | string)", value: input.user_agent }, _errorFactory)) && ("paid" === input.status || "ready" === input.status || "failed" === input.status || "cancelled" === input.status || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".status", expected: "(\"cancelled\" | \"failed\" | \"paid\" | \"ready\")", value: input.status }, _errorFactory)) && ("number" === typeof input.started_at && !Number.isNaN(input.started_at) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".started_at", expected: "number", value: input.started_at }, _errorFactory)) && ("number" === typeof input.paid_at && !Number.isNaN(input.paid_at) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".paid_at", expected: "number", value: input.paid_at }, _errorFactory)) && ("number" === typeof input.failed_at && !Number.isNaN(input.failed_at) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".failed_at", expected: "number", value: input.failed_at }, _errorFactory)) && ("number" === typeof input.cancelled_at && !Number.isNaN(input.cancelled_at) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".cancelled_at", expected: "number", value: input.cancelled_at }, _errorFactory)) && (null === input.fail_reason || "string" === typeof input.fail_reason || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".fail_reason", expected: "(null | string)", value: input.fail_reason }, _errorFactory)) && (null === input.cancel_reason || "string" === typeof input.cancel_reason || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".cancel_reason", expected: "(null | string)", value: input.cancel_reason }, _errorFactory)) && ((Array.isArray(input.cancel_history) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".cancel_history", expected: "Array<IIamportPaymentCancel>", value: input.cancel_history }, _errorFactory)) && input.cancel_history.every(function (elem, _index7) { return ("object" === typeof elem && null !== elem || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".cancel_history[" + _index7 + "]", expected: "IIamportPaymentCancel", value: elem }, _errorFactory)) && _ao2(elem, _path + ".cancel_history[" + _index7 + "]", true && _exceptionable) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".cancel_history[" + _index7 + "]", expected: "IIamportPaymentCancel", value: elem }, _errorFactory); }) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".cancel_history", expected: "Array<IIamportPaymentCancel>", value: input.cancel_history }, _errorFactory)); }; var _ao2 = function (input, _path, _exceptionable) { if (_exceptionable === void 0) { _exceptionable = true; } return ("string" === typeof input.pg_id || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".pg_id", expected: "string", value: input.pg_id }, _errorFactory)) && ("string" === typeof input.pg_tid || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".pg_tid", expected: "string", value: input.pg_tid }, _errorFactory)) && ("number" === typeof input.amount && !Number.isNaN(input.amount) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".amount", expected: "number", value: input.amount }, _errorFactory)) && ("number" === typeof input.cancelled_at && !Number.isNaN(input.cancelled_at) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".cancelled_at", expected: "number", value: input.cancelled_at }, _errorFactory)) && ("string" === typeof input.reason || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".reason", expected: "string", value: input.reason }, _errorFactory)) && ("string" === typeof input.receipt_url && (__nestia_core_transform_isFormatUri._isFormatUri(input.receipt_url) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".receipt_url", expected: "string & Format<\"uri\">", value: input.receipt_url }, _errorFactory)) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".receipt_url", expected: "(string & Format<\"uri\">)", value: input.receipt_url }, _errorFactory)); }; var _ao3 = function (input, _path, _exceptionable) { if (_exceptionable === void 0) { _exceptionable = true; } return ("string" === typeof input.bank_code || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".bank_code", expected: "string", value: input.bank_code }, _errorFactory)) && ("string" === typeof input.bank_name || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".bank_name", expected: "string", value: input.bank_name }, _errorFactory)) && ("trans" === input.pay_method || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".pay_method", expected: "\"trans\"", value: input.pay_method }, _errorFactory)) && ("string" === typeof input.imp_uid || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".imp_uid", expected: "string", value: input.imp_uid }, _errorFactory)) && ("string" === typeof input.merchant_uid || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".merchant_uid", expected: "string", value: input.merchant_uid }, _errorFactory)) && (null === input.name || "string" === typeof input.name || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".name", expected: "(null | string)", value: input.name }, _errorFactory)) && ("number" === typeof input.amount && !Number.isNaN(input.amount) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".amount", expected: "number", value: input.amount }, _errorFactory)) && ("number" === typeof input.cancel_amount && !Number.isNaN(input.cancel_amount) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".cancel_amount", expected: "number", value: input.cancel_amount }, _errorFactory)) && ("KRW" === input.currency || "USD" === input.currency || "EUR" === input.currency || "JPY" === input.currency || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".currency", expected: "(\"EUR\" | \"JPY\" | \"KRW\" | \"USD\")", value: input.currency }, _errorFactory)) && ("string" === typeof input.receipt_url && (__nestia_core_transform_isFormatUri._isFormatUri(input.receipt_url) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".receipt_url", expected: "string & Format<\"uri\">", value: input.receipt_url }, _errorFactory)) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".receipt_url", expected: "(string & Format<\"uri\">)", value: input.receipt_url }, _errorFactory)) && ("boolean" === typeof input.cash_receipt_issue || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".cash_receipt_issue", expected: "boolean", value: input.cash_receipt_issue }, _errorFactory)) && ("string" === typeof input.channel || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".channel", expected: "string", value: input.channel }, _errorFactory)) && ("string" === typeof input.pg_provider || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".pg_provider", expected: "string", value: input.pg_provider }, _errorFactory)) && (null === input.emb_pg_provider || "string" === typeof input.emb_pg_provider || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".emb_pg_provider", expected: "(null | string)", value: input.emb_pg_provider }, _errorFactory)) && ("string" === typeof input.pg_id || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".pg_id", expected: "string", value: input.pg_id }, _errorFactory)) && ("string" === typeof input.pg_tid || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".pg_tid", expected: "string", value: input.pg_tid }, _errorFactory)) && ("boolean" === typeof input.escrow || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".escrow", expected: "boolean", value: input.escrow }, _errorFactory)) && (null === input.buyer_name || "string" === typeof input.buyer_name || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".buyer_name", expected: "(null | string)", value: input.buyer_name }, _errorFactory)) && (null === input.buyer_email || "string" === typeof input.buyer_email && (__nestia_core_transform_isFormatEmail._isFormatEmail(input.buyer_email) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".buyer_email", expected: "string & Format<\"email\">", value: input.buyer_email }, _errorFactory)) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".buyer_email", expected: "((string & Format<\"email\">) | null)", value: input.buyer_email }, _errorFactory)) && (null === input.buyer_tel || "string" === typeof input.buyer_tel || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".buyer_tel", expected: "(null | string)", value: input.buyer_tel }, _errorFactory)) && (null === input.buyer_addr || "string" === typeof input.buyer_addr || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".buyer_addr", expected: "(null | string)", value: input.buyer_addr }, _errorFactory)) && (null === input.buyer_postcode || "string" === typeof input.buyer_postcode || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".buyer_postcode", expected: "(null | string)", value: input.buyer_postcode }, _errorFactory)) && (null === input.customer_uid || "string" === typeof input.customer_uid || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".customer_uid", expected: "(null | string)", value: input.customer_uid }, _errorFactory)) && (null === input.customer_uid_usage || "string" === typeof input.customer_uid_usage || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".customer_uid_usage", expected: "(null | string)", value: input.customer_uid_usage }, _errorFactory)) && (null === input.custom_data || "string" === typeof input.custom_data || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".custom_data", expected: "(null | string)", value: input.custom_data }, _errorFactory)) && (null === input.user_agent || "string" === typeof input.user_agent || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".user_agent", expected: "(null | string)", value: input.user_agent }, _errorFactory)) && ("paid" === input.status || "ready" === input.status || "failed" === input.status || "cancelled" === input.status || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".status", expected: "(\"cancelled\" | \"failed\" | \"paid\" | \"ready\")", value: input.status }, _errorFactory)) && ("number" === typeof input.started_at && !Number.isNaN(input.started_at) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".started_at", expected: "number", value: input.started_at }, _errorFactory)) && ("number" === typeof input.paid_at && !Number.isNaN(input.paid_at) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".paid_at", expected: "number", value: input.paid_at }, _errorFactory)) && ("number" === typeof input.failed_at && !Number.isNaN(input.failed_at) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, { method: "core.TypedRoute.Get", path: _path + ".failed_at", expected: "number", value: input.failed_at }, _errorFactory)) && ("number" === typeof input.cancelled_at && !Number.isNaN(input.cancelled_at) || __nestia_core_transform_assertGuard._assertGuard(_exceptionable, {