feat: 微信V3 + 支付宝手机站/UA自适应 + 业务对接(签名下单/webhook) + 通用多业务
- 微信支付 V3 Native 渠道 (wechat.go):Native下单/回调AES-GCM解密验签/查单 - 支付宝:手机网站支付 wap.pay + 按 UA 自适应(PC page.pay扫码 / 手机拉App);qr_pay_mode=2 完整扫码收银台 - 业务对接:下单接口扩展(biz_system/biz_ref/return_url)+ HMAC 签名鉴权;支付成功 webhook 主动推送业务方 + 60s 重试 + BizNotifyLog - 通用多业务:config.biz 改 map,加业务只改配置(BIZ_<SYS>_SECRET/_CALLBACK_URL) - seedPlans:四档真实套餐 + promo_first_month(¥1) + test_liandiao(0.01),均挂 biz_code;/products 暴露 biz_code - 删除沙箱 pay.html;对接设计文档入 docs Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019UQmqWmV67sXGLrb3U1XXn
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# pay — 独立支付服务
|
||||
|
||||
多业务 × 多渠道的收款服务。**支付宝先行(PC 网页支付),微信留接口**(无沙箱,待真实商户号)。
|
||||
多业务 × 多渠道的收款服务。**支付宝(电脑网站支付)+ 微信(V3 Native 扫码)**(微信无沙箱,待真实商户号配置后可用)。
|
||||
栈:Go 1.26 · Gin · GORM(SQLite 纯 Go 驱动,零 cgo)。
|
||||
|
||||
## 目录结构
|
||||
@@ -16,7 +16,7 @@ pay/
|
||||
│ ├── handler/ # HTTP:收款页·套餐·下单·回调·查状态
|
||||
│ ├── router/ # 路由装配
|
||||
│ └── util/ # 响应 / 金额(分) / 订单号生成
|
||||
├── web/ # pay.html 收款页 · result.html 结果页
|
||||
├── web/ # result.html 支付结果页 · qrcode 二维码渲染
|
||||
└── docs/ # 设计文档(index.html 索引)
|
||||
```
|
||||
|
||||
@@ -31,13 +31,15 @@ pay/
|
||||
|
||||
| 方法 | 路径 | 说明 |
|
||||
|---|---|---|
|
||||
| GET | `/` | 收款页 |
|
||||
| GET | `/result?out_trade_no=` | 结果页(return_url 落地) |
|
||||
| GET | `/qrcode?text=` | 把码串渲染成二维码 PNG(微信 code_url / 支付宝扫码) |
|
||||
| GET | `/health` | 健康检查 |
|
||||
| GET | `/api/v1/products` | 上架套餐列表 |
|
||||
| POST | `/api/v1/orders` | 下单,返回 `pay_url` |
|
||||
| POST | `/api/v1/orders` | 网页支付下单,返回 `pay_url`(支付宝电脑网站支付跳转) |
|
||||
| POST | `/api/v1/orders/qr` | 扫码下单,返回 `qr_code` 码串(微信 Native / 支付宝当面付) |
|
||||
| GET | `/api/v1/orders/:out_trade_no` | 查订单状态(结果页轮询) |
|
||||
| POST | `/api/v1/notify/alipay` | 支付宝异步回调 |
|
||||
| POST | `/api/v1/notify/wechat` | 微信异步回调(V3 解密验签) |
|
||||
|
||||
## 沙箱联调步骤
|
||||
|
||||
|
||||
Reference in New Issue
Block a user