xinetzone/SpecWeave / .agents/skills/alipay-payment-integration
alipay-payment-integration
Flagged支付宝开放平台支付产品接入最佳实践。涵盖当面付、订单码支付、App 支付、JSAPI 支付、手机网站支付、电脑网站支付、预授权支付、商家扣款等全场景产品选型与集成指导。 当用户提到"接入支付宝"、"集成支付宝支付"、"对接支付"、"支付宝收款"、"加个支付功能"、"支付宝下单"、"H5 支付"、"小程序支付"、"预授权"、"付款码"、"扫码支付"、"网页支付"、"PC 支付"、"周期扣款"、"自动续费"、"会员订阅"、"连续包月"、"代扣"时,或咨询支付产品相关报错、排查问题时使用此 Skill。
references/alipay-sandbox/alipay-sandbox-tool.md
View on GitHub# Alipay Sandbox Tool
提供沙箱能力:**创建快速沙箱**,返回示例见 [EXAMPLES.md](./EXAMPLES.md)。
## 1. 环境检测
### 1.1 CLI 探测
```bash
which alipay 2>/dev/null && alipay version
```
### 1.2 安装(如未检测到)
```bash
curl -fsSL https://mdn.alipayobjects.com/nexuspaybase_saas/uri/file/as/alipaycli-install.sh | sh
```
安装脚本按以下优先级选择安装目录:
1. `/usr/local/bin`(若目录存在且当前用户可写,无需 sudo)
2. `/usr/local/bin`(若有 sudo 免密权限,需 sudo)
3. `~/.local/bin`(以上均不满足时的回退路径)
### 1.3 安装验证
```bash
alipay version
```
若提示 command not found,尝试 `source ~/.zshrc`(或 `~/.bashrc`)刷新 PATH,或直接使用绝对路径 `/usr/local/bin/alipay` 或 `~/.local/bin/alipay`。
## 2. 创建快速沙箱
**重要:输出时必须完整展示所有字段,不允许省略 privateKey、publicKey 等长字段。如果输出被截断,需重新输出完整内容。**
```bash
S1="<PRODUCT>" alipay sandbox create
```
**参数说明:**
| 变量 | 说明 |
|------|------|
| `PRODUCT` | 前序 Skill 中产品决策出的支付产品名称(如:手机网站支付、电脑网站支付) |
**结果解析:**
1. 取 `result.content[0].text`,去转义还原 JSON
2. `success === true` → 输出简短成功提示,将 `data` 字段**完整原样**按 [沙箱环境初始化](sandbox-setup-guide.md) 中的沙箱信息输出格式以表格展示,保持原始字段值不变,不做任何脱敏、省略或重排
3. `success !== true` → 按错误处理流程
## 3. 错误处理
CLI 输出不暴露 HTTP 状态码,统一按响应体中的 `success` 字段判断:
| 条件 | 策略 |
|------|------|
| `success === false` 且 `msg` 含"证书密钥"等临时错误 | 静默等待 2 秒后自动重试 1 次,仍失败则展示 `errorCode`、`msg`/`resultMsg`、`traceId` |
| `success === false` 且 `msg` 含"版本过旧"或 CLI 退出码非 0 | 不重试,友好提示"服务不可用,可能是 CLI 版本过旧",询问用户是否升级 CLI |
| CLI 执行超时或网络错误 | 最多重试 2 次 |
## 4. 注意事项
- 执行前向用户展示即将运行的命令
- 参数不确定时先向用户确认Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |