Skip to content

[BUG] WxPayRefundNotifyV3Result.Amount 缺少退款金额字段 #4000

Description

@binarywang

问题描述

严重程度:低

问题模块:退款通知回调

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

问题内容

WxPayRefundNotifyV3Result(退款通知V3结果解析类)的 Amount 内部类缺少完整的退款金额字段。

当前 SDK 中 WxPayRefundNotifyV3Result.Amount 仅包含:

  • payer_refund
  • payer_total

但官方退款通知回调文档中,解密后的 amount 对象应包含以下字段:

  • refund_fee:退款金额
  • settlement_refund:退款结算金额
  • total:订单总金额
  • currency:币种
  • payer_total:用户支付金额
  • payer_refund:用户退款金额
  • settlement_total:结算金额
  • discount_refund:优惠券退款金额
  • from:退款账户来源(部分退回时存在)

影响范围

商户接收微信支付退款通知后,无法通过 SDK 获取完整的退款金额信息,需要自行解析通知数据。


官方文档参考

退款申请API文档:https://pay.weixin.qq.com/doc/v3/merchant/4013070371
(退款通知回调部分)

对应SDK文件

  • weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/WxPayRefundNotifyV3Result.java
  • WxPayRefundNotifyV3Result.Amount 内部类

实现要点

在 WxPayRefundNotifyV3Result.Amount 类中补充以下字段:

@SerializedName("refund_fee")
private Integer refundFee;        // 退款金额

@SerializedName("settlement_refund")
private Integer settlementRefund; // 退款结算金额

@SerializedName("total")
private Integer total;            // 订单总金额

@SerializedName("currency")
private String currency;         // 币种

@SerializedName("settlement_total")
private Integer settlementTotal;   // 结算金额

@SerializedName("discount_refund")
private Integer discountRefund;   // 优惠券退款金额

// from字段用于部分账户退款场景
@SerializedName("from")
private List<FromItem> from;      // 退款账户来源

其中 FromItem 内部类包含 account 和 amount 字段。

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