Files
junhong_cmp_fiber/openspec/changes/archive/2026-08-18-add-fuiou-scan-agent-recharge/tasks.md
2026-08-18 17:13:20 +08:00

34 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 1. 富友主扫下单与查询客户端
- [x] 1.1 在 `pkg/fuiou` 新增主扫统一下单请求/响应结构(`/preCreate`,含 `order_type``notify_url``reserved_expire_minute`,响应含 `qr_code`
- [x] 1.2 在 `pkg/fuiou` 新增主扫下单方法,复用 `Client.Sign``DoRequest`
- [x] 1.3 在 `pkg/fuiou` 新增订单查询请求/响应结构(`/commonQuery`,响应含 `trans_stat``order_amt``transaction_id``reserved_txn_fin_ts`
- [x] 1.4 在 `pkg/fuiou` 新增订单查询方法,复用 `Client.Sign``DoRequest`
- [x] 1.5 补充 `trans_stat` 到统一支付状态的映射SUCCESS→已支付PAYERROR/CLOSED/REVOKED→已关闭USERPAYING/NOTPAY→待支付其余→未知
## 2. 富友扫码 Adapter
- [x] 2.1 新增 `internal/infrastructure/payment/fuiou_scan.go``FuiouScanAdapter`,实现 `OnlinePaymentPort`
- [x] 2.2 `Available` 判定 `provider_type==fuiou` 且富友机构号/商户号/终端号/私钥/公钥/API 地址/通知地址完整
- [x] 2.3 `CreatePaymentURL` 调主扫下单并以 `qr_code` 作为 `QRContent`,接入外部交互日志
- [x] 2.4 `Query` 调订单查询并按映射返回统一查询结果
## 3. 代理在线充值 Adapter 选择与渠道事实
- [x] 3.1 `OnlineCreationService` 注入富友 Adapter`adapter()` 增加配置参数并按 `provider_type==fuiou` 分流
- [x] 3.2 `RecoverOnlinePaymentService` 同样注入并按配置分流,恢复阶段富友只查单不重建链接
- [x] 3.3 `paymentMerchantIdentity` 在富友下返回 `FyMchntCd`
- [x] 3.4 创建本地事实时 `PaymentChannel``fuiou``PaymentMethod` 仍存 `wechat`
## 4. 回调与确认校验
- [x] 4.1 `confirmAgentRechargePayment` 将回调 `PaymentMethod==fuiou` 归一化为业务方式 `wechat` 后再进入确认用例
- [x] 4.2 `domain.ValidatePaymentConfirmation` 允许 `channel=fuiou` 对应 `method=wechat`,保留其余一致性校验
## 5. 装配与验证
- [x] 5.1 `bootstrap/services.go` 注入富友扫码 Adapter 到在线创建与恢复服务
- [x] 5.2 `gofmt -w` 变更文件,`go build ./cmd/api ./cmd/worker` 通过
- [x] 5.3 `go run cmd/gendocs/main.go` 重新生成文档(如路由/DTO 有变化)
- [x] 5.4 `openspec validate --all` 通过