Skip to main content
Glama

yeepay-mcp

by yop-platform
config.ts1.34 kB
import dotenv from "dotenv"; // 加载环境变量,确保只加载一次 dotenv.config(); // 读取并验证环境变量 const parentMerchantNo = process.env.YOP_PARENT_MERCHANT_NO; const merchantNo = process.env.YOP_MERCHANT_NO; const appPrivateKey = process.env.YOP_APP_PRIVATE_KEY; // 商户私钥 const appKey = process.env.YOP_APP_KEY; const notifyUrl = process.env.YOP_NOTIFY_URL; // createPayment 需要 const yopPublicKey = process.env.YOP_PUBLIC_KEY; if (!parentMerchantNo || !merchantNo || !appPrivateKey || !appKey) { const errorMsg = "Missing required Yeepay configuration in environment variables (YOP_PARENT_MERCHANT_NO, YOP_MERCHANT_NO, YOP_APP_PRIVATE_KEY, YOP_APP_KEY)"; throw new Error(errorMsg); // 直接抛出错误 } // notifyUrl 只在 createPayment 中是必需的,但在这里检查可以更早发现问题 if (!notifyUrl) { const errorMsg = "Missing required Yeepay configuration in environment variables (YOP_NOTIFY_URL)"; throw new Error(errorMsg); // 直接抛出错误 } // 导出配置对象, 使用 as const 使其深度只读 export const config = { parentMerchantNo, merchantNo, appPrivateKey, appKey, notifyUrl, yopPublicKey, } as const; // Apply as const assertion // Object.freeze(config); // Removed runtime freeze, relying on compile-time readonly via 'as const'

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yop-platform/yeepay-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server