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

2.0 KiB
Raw Blame History

Why

当前生效支付配置为富友(provider_type=fuiou)时,代理在线充值可用支付方式接口只返回 alipay,不返回 wechat。原因是现有微信 Adapter 只支持微信直连(wechat/wechat_v2),而富友虽然本质是微信支付上游通道,却未接入代理在线充值链路。本变更让富友主扫下单成为内部 wechat 通道,使代理在线充值在富友配置下也能展示并完成微信扫码支付。

What Changes

  • 代理在线充值 payment-methods 在富友配置完整时把 wechat 列为可用支付方式(对外枚举仍只有 wechatalipay,不新增 fuiou)。
  • POST /api/admin/agent-recharges 使用 wechat 创建时,若生效配置为富友,则调用富友主扫统一下单,返回 qr_code 作为支付链接。
  • 新增富友主扫下单(/preCreate)与主动查单(/commonQuery)客户端能力;支付结果继续复用现有富友异步通知回调。
  • 代理在线充值支付恢复(主动查单)在富友通道下通过 commonQuery 收敛状态,不重建链接。
  • 支付确认校验允许富友渠道(channel=fuiou)对应业务支付方式 wechat

Capabilities

New Capabilities

(无)

Modified Capabilities

  • agent-funds-commission: 代理在线充值可用支付方式与创建行为在富友配置下按微信通道处理。
  • external-integration: 富友主扫统一下单与订单查询的调用、状态映射与失败边界。

Impact

  • internal/application/agentrechargeOnlineCreationServiceRecoverOnlinePaymentService、确认用例渠道校验)
  • internal/domain/agentrecharge(支付确认渠道一致性校验)
  • internal/infrastructure/payment(新增富友扫码 Adapter
  • pkg/fuiou(新增主扫下单与订单查询请求/响应)
  • internal/handler/callback(富友回调支付方式归一化为业务方式 wechat
  • 无数据库迁移、无新外部依赖;对外支付方式枚举不变。