Skip to main content
Glama

💳 unified-pay-cli

通用支付网关 CLI 与模型上下文协议(MCP)服务器,支持 Stripe、Razorpay 和 LemonSqueezy。

npm 版本 许可证: MIT MCP 协议 欢迎 PR


🚀 亮点

  • 零安装要求: 通过 npx unified-pay-cli 按需即时运行。

  • 🎯 多提供商引擎:StripeRazorpayLemonSqueezy 之间提供标准化接口。

  • 🛠️ 智能支付链接生成: 交互式终端 UI 提示或直接脚本化 CLI 标志。

  • 🔄 完整的交易与退款生命周期: 实时状态检查、近期交易列表、部分/全额退款以及专用退款进度跟踪。

  • 📡 Webhook 站与转发代理: 内置 HTTP 监听器(pay listen),可拦截、着色并直接将 Webhook 事件转发到您的本地后端(--forward http://localhost:3000/api/webhooks)。

  • 🔒 加密签名验证: 内置 HMAC-SHA256 验证(--secret),保护您的本地开发环境免受伪造或篡改的 Webhook 负载。

  • 🤖 原生模型上下文协议(MCP): 将您的支付栈连接到 GitHub Copilot、Cursor 或 Claude Desktop,让 AI 能够通过自然语言提示创建链接、验证签名和跟踪发票。


Related MCP server: mcp-dev-brasil

⚡ 快速开始

1. 安装

全局安装或通过 npx 按需运行:

# Global install (recommended for daily CLI use)
npm install -g unified-pay-cli

# Or run instantly with npx
npx unified-pay-cli --help

2. 配置凭据

# Stripe
pay config --stripe-key sk_test_51...

# Razorpay
pay config --razorpay-id rzp_test_... --razorpay-secret ...

# LemonSqueezy (Optional)
pay config --lemonsqueezy-key lms_... --lemonsqueezy-store 12345

💻 CLI 命令参考

1. 创建支付链接(pay link

# Interactive mode (prompts for provider, amount, description)
pay link

# Scriptable flag mode
pay link --provider razorpay --amount 350000 --currency INR --desc "2-Hour Technical Consultation"
pay link --provider stripe --amount 2500 --currency USD --desc "Pro Tier Subscription"

2. 检查交易(pay txn

# List recent transactions
pay txn list --provider razorpay --limit 5

# Check specific payment details
pay txn status pay_Oq7Jk8LmNx9 --provider razorpay

3. 发起与跟踪退款(pay refund

pay 处理费用与退款实体的独立生命周期:

# Issue a refund (full or partial in minor units)
pay refund create pay_Oq7Jk8LmNx9 --provider razorpay --amount 10000

# Track live refund progression
pay refund status rfnd_TRNTRFvhQ6NDKx --provider razorpay

# List all past refunds
pay refund list --provider razorpay

4. Webhook 站、验证与代理(pay listen

在本地开发期间捕获实时 Webhook 事件,无需复杂的隧道设置:

# 1. Basic listener
pay listen --port 4242

# 2. Listener with HMAC-SHA256 signature verification
pay listen --port 4242 --secret my_webhook_signing_secret

# 3. Listener with signature verification + proxy forwarding to local backend
pay listen --port 4242 --secret my_webhook_secret --forward http://localhost:3000/api/webhooks

🤖 模型上下文协议(MCP)集成

将您的 AI 助手转变为自主的计费和支付操作员。

1. 添加到 VS Code / GitHub Copilot(.vscode/mcp.json

{
  "mcpServers": {
    "unified-pay": {
      "command": "npx",
      "args": ["-y", "unified-pay-cli", "mcp"]
    }
  }
}

2. 可用的 AI 工具

工具名称

描述

create_payment_link

使用自定义金额、货币和备注创建结账 URL。

list_transactions

获取最近的费用和验证状态。

get_payment_status

检查特定支付 ID(pay_xxx, ch_xxx)的生命周期状态。

create_refund

触发全额或部分退款。

get_refund_status

跟踪退款 ID(rfnd_xxx, re_xxx)的实时状态。

list_refunds

列出历史退款记录。

verify_webhook_signature

验证传入 Stripe/Razorpay 负载的 HMAC-SHA256 真实性。

3. AI 提示示例

Use unified-pay to generate a INR 3,500 Razorpay payment link for "2-Hour Technical Consultation" and draft a WhatsApp message for the client.
Check if payment ID pay_Oq7Jk8LmNx9 on Razorpay was successfully captured.
Issue a full refund for Stripe charge ch_3Mtw1234 using unified-pay.
Verify if this incoming Razorpay webhook payload and signature are authentic using my signing secret.

🧪 测试与验证

# Run unit tests
npm test

# Run tests in watch mode
npm run test:watch

🛠️ 开发

# 1. Clone the repository
git clone https://github.com/your-username/unified-pay-cli.git
cd unified-pay-cli

# 2. Install dependencies
npm install

# 3. Build TypeScript
npm run build

# 4. Symlink globally for local testing
npm link

📄 许可证

基于 MIT 许可证分发。详情请参阅 LICENSE。

A
license - permissive license
-
quality - not tested
A
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (12mo)
Commit activity

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    Centralizes payment gateway integrations for Pagar.me (customers, recipients, Pix, credit card, splits, charges) and Woovi/OpenPix (Pix charges, refunds, webhook verification) through MCP tools.
    9
    MIT
  • A
    license
    -
    quality
    B
    maintenance
    37 MCP servers for agentic commerce and Brazilian services. Covers Stripe ACP, x402 (Coinbase), AP2 (Google), Google UCP, plus 14 traditional Brazilian payment rails, fiscal, banking, communication, logistics, ERP, identity, and crypto APIs. ~480 tools. Supports stdio and Streamable HTTP.
    267
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    Universal billing gateway for MCP servers. Add Stripe subscription billing to any MCP server with one line of code. Supports tiered plans, usage tracking, and automatic access control.
    1
    1
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    An MCP (Model Context Protocol) server that connects AI assistants like Claude directly to your Razorpay account.
    14
    33
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • A paid remote MCP for CLI tool MCP, built to return verdicts, receipts, usage logs, and audit-ready

  • Agent-commerce MCP server for x402/USDC payments and affiliate splits on Base.

  • MCP server integrating with Stripe - tools for customers, products, payments, and more.

View all MCP Connectors

Latest Blog Posts

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/pritam825/unified-pay-cli'

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