UNPKG

node-ecpay-aio

Version:

A production-ready ECPay AIO SDK for Node.js with TypeScript support.

62 lines (61 loc) 2.41 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 __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; }; Object.defineProperty(exports, "__esModule", { value: true }); const yup = __importStar(require("yup")); const BasePaymentParamsSchema = yup.object().shape({ MerchantTradeNo: yup .string() .strict() .min(4) .max(20) .required() .matches(/^[a-zA-Z0-9]+$/), MerchantTradeDate: yup .string() .strict() .required() .matches(/^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}$/), TotalAmount: yup.number().integer().strict().required(), TradeDesc: yup.string().strict().max(200).required(), ItemName: yup.string().strict().max(400).required(), ReturnURL: yup .string() .max(200) .matches(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/), StoreID: yup.string().max(20).strict(), ClientBackURL: yup.string().max(200), ItemURL: yup .string() .max(200) .matches(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/), Remark: yup.string().max(100).strict(), OrderResultURL: yup.string().max(200), NeedExtraPaidInfo: yup.string().oneOf(['Y', 'N']), CustomField1: yup.string().max(50).strict(), CustomField2: yup.string().max(50).strict(), CustomField3: yup.string().max(50).strict(), CustomField4: yup.string().max(50).strict(), }); exports.default = BasePaymentParamsSchema;