feat(M08-A): 接入充值微信支付调起

This commit is contained in:
Codex
2026-06-25 12:40:21 +08:00
parent 2bbb16e6f0
commit 53f5d6776f
17 changed files with 701 additions and 11 deletions
@@ -157,3 +157,32 @@ M08-A 仍为 `PARTIAL`。本次完成顾客端第一段工程闭环,但订单
- 工程提交:`e24920c`
- 远端校验:待本轮 push 后执行 `HEAD == origin/main`
## 2026-06-25 续接:顾客端充值微信支付调起
- 数据库新增 `2026062524_m08a_recharge_wechat` 迁移,为 `qipai_recharge_orders` 增加微信预支付 ID、微信交易号、回调幂等 ID 和脱敏通知 JSON,避免把充值单伪造成订单支付。
- `RechargeService` 新增 `createWechatPrepay``processWechatNotification`,充值预支付复用微信支付配置、顾客 openid 和 JSAPI 参数生成;微信通知验签解密后按充值单号入账,重复通知不重复加余额。
- `POST /app-api/recharge/orders/:rechargeOrderId/wechat-prepay` 暴露给小程序,校验当前登录顾客只能为本人充值单调起支付。
- `POST /app-api/recharge/wechat/notify` 新增充值微信支付通知入口,通知 payload 入库前移除 `payer`
- 小程序充值页新增“微信支付”按钮,创建充值单后可调起微信支付;到账结果以后端通知和个人中心余额为准。
- 迁移 runner 白名单纳入新迁移,并补充 API/DB changelog。
验收:
- `npm run build``backend/`):PASS。
- `node scripts/check-miniapp-m08-a.mjs`PASS。
- `node tests/recharge-service.test.mjs`PASS。
- `node tests/recharge-route.test.mjs`PASS。
- `node tests/migration-contract.test.mjs`PASS。
- `node tests/migration-runner.test.mjs`PASS。
- `node tests/wechat-pay.test.mjs`PASS。
- `npm test``backend/`):PASS。
状态:
- M08-A 仍为 `PARTIAL`;余额/套餐/优惠券下单抵扣深度集成、真机合法域名、真实微信支付和实物开门验证待继续。
提交:
- 工程提交:待本轮 commit 后记录。
- 远端校验:待本轮 push 后执行 `HEAD == origin/main`