Skip to content

[BUG] WxPayRefundV3Request 缺少 funds_account 参数(普通商户版) #3999

Description

@binarywang

问题描述

严重程度:中

问题模块:退款申请

SDK版本:4.7.5.B (Maven中央仓库) / 4.8.3.B (develop分支)

问题内容

WxPayRefundV3Request(普通商户版申请退款请求类)缺少 funds_account 字段,导致无法在退款申请时指定退款资金来源账户。

官方API文档明确支持在退款申请时通过 funds_account 参数指定资金来源:

  • AVAILABLE:可用余额
  • UNSETTLED:未结算资金

服务商版 WxPayPartnerRefundV3Request 已实现该字段,但普通商户版 WxPayRefundV3Request 缺失此字段。


影响范围

  • 仅影响普通商户(直连商户)调用退款接口
  • 服务商调用 WxPayPartnerRefundV3Request 不受影响
  • 商户无法在代码中指定退款资金来源,依赖系统默认行为

官方文档参考

退款申请API文档:https://pay.weixin.qq.com/doc/v3/merchant/4013070371

对应SDK文件

  • weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayRefundV3Request.java
  • 对比参考(已有):WxPayPartnerRefundV3Request(服务商版)

实现要点

在 WxPayRefundV3Request 类中添加以下字段:

/**
 * 字段名:退款资金来源
 * 变量名:funds_account
 * 是否必填:否
 * 类型:string
 * 描述:
 *  退款资金来源,枚举值:
 *  AVAILABLE:可用余额
 *  UNSETTLED:未结算资金
 */
@SerializedName(value = "funds_account")
private String fundsAccount;

同时需要在 WxPayRefundV3Request.Amount 内部类中添加 from 字段(用于指定部分账户退款时的资金来源数组),官方文档链接同上。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions