@35m/cli
v0.1.0
Published
35pay command-line tool — JSON-first, agent-friendly. PaymentLink / checkout / refund from your shell.
Downloads
71
Maintainers
Readme
@35m/cli
35pay 命令行工具,JSON 输出,agent 友好。
安装
npm i -g @35m/cli
# 或
npx @35m/cli help用法
export PAY_KEY=sk_test_xxx # 或 sk_live_xxx
# 创建支付
35pay checkout create --amount 9900 --currency CNY \
--description "顾问费" \
--metadata '{"orderId":"o_001"}' \
--success-url https://yoursite.com/done \
--pretty
# 输出(一行 JSON,--pretty 缩进):
# {
# "id": "sess_abc123",
# "url": "https://pay.35team.com/c/sess_abc123",
# "status": "pending",
# "amount": 9900,
# "currency": "CNY",
# "mode": "test"
# }
# 查询状态
35pay checkout get sess_abc123
# 退款
35pay refund rec_xyz789 --amount 5000 --reason "客户要求"
# 帮助
35pay helpAgent / 脚本场景
# pipe 给 jq 处理
SK=sk_test_xxx 35pay checkout create --amount 100 --currency CNY \
| jq -r '.url'
# https://pay.35team.com/c/sess_xxx
# 一句话帮人收款
LINK=$(35pay checkout create --amount 9900 --currency CNY --description "$1" | jq -r '.url')
echo "付款链接:$LINK" | mail -s "付款" [email protected]Env
| 变量 | 默认 | 说明 |
|---|---|---|
| PAY_KEY | (必填) | sk_test_xxx 或 sk_live_xxx |
| PAY_BASE_URL | https://pay.35team.com | 自部署 / 测试覆盖 |
退出码
0成功1用法错误 / 鉴权失败 / API 报错(错误以 JSON 形式打到 stderr)
错误格式
{ "error": "HTTP 401: Invalid API key" }