Skip to content

修复退款请求 funds_account 重复映射冲突,确保 V3 退款参数可正确序列化#4025

Open
Copilot wants to merge 2 commits into
developfrom
copilot/add-funds-account-parameter
Open

修复退款请求 funds_account 重复映射冲突,确保 V3 退款参数可正确序列化#4025
Copilot wants to merge 2 commits into
developfrom
copilot/add-funds-account-parameter

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 27, 2026

问题聚焦在 V3 退款参数 funds_account 的可用性:普通商户退款请求需要支持该字段及 amount.from 资金出资明细。当前代码中普通商户模型已具备这两个参数,但服务商退款子类对 funds_account 的重复声明会导致 Gson 序列化冲突。

  • 变更摘要

    • WxPayPartnerRefundV3Request 中移除重复的 fundsAccount 字段定义(保留父类 WxPayRefundV3Request 的统一定义)。
    • 保持 WxPayRefundV3Requestfunds_accountAmount.from 的现有结构不变,避免接口参数语义漂移。
    • 结果是普通商户与服务商退款请求均通过同一字段映射输出 funds_account,不再触发重复 JSON 字段异常。
  • 影响范围

    • weixin-java-pay 模块退款请求模型(V3)。
    • 不涉及 API 行为变更,仅修正请求对象序列化一致性与兼容性。
WxPayRefundV3Request request = new WxPayRefundV3Request();
request.setOutRefundNo("1217752501201407033233368018");
request.setFundsAccount("AVAILABLE");

WxPayRefundV3Request.From from = new WxPayRefundV3Request.From();
from.setAccount("AVAILABLE");
from.setAmount(444);

WxPayRefundV3Request.Amount amount = new WxPayRefundV3Request.Amount();
amount.setRefund(888);
amount.setTotal(888);
amount.setCurrency("CNY");
amount.setFrom(java.util.Collections.singletonList(from));
request.setAmount(amount);

Copilot AI changed the title [WIP] Add funds_account parameter to WxPayRefundV3Request 修复退款请求 funds_account 重复映射冲突,确保 V3 退款参数可正确序列化 May 27, 2026
Copilot AI requested a review from binarywang May 27, 2026 13:06
@binarywang binarywang marked this pull request as ready for review May 31, 2026 14:16
Copilot AI review requested due to automatic review settings May 31, 2026 14:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

移除 WxPayPartnerRefundV3Request 中与父类 WxPayRefundV3Request 重复定义的 fundsAccount 字段,避免 Gson 在序列化时因同一 JSON 字段 funds_account 被声明两次而冲突,统一普通商户与服务商退款请求的字段映射。

Changes:

  • 删除子类中重复的 fundsAccount 字段及其 @SerializedName("funds_account") 注解,保留父类定义。

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 35765158db

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

*/
@SerializedName(value = "funds_account")
private String fundsAccount;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the partner fundsAccount setter ABI

Removing this field also removes Lombok's generated WxPayPartnerRefundV3Request setFundsAccount(String) method. Existing applications compiled against the previous artifact will still invoke that exact descriptor and can hit NoSuchMethodError after upgrading, because the inherited setter returns WxPayRefundV3Request instead; recompilation also breaks chains where a partner-specific setter follows setFundsAccount. Please add an explicit forwarding setter on the partner request that writes the inherited property and returns WxPayPartnerRefundV3Request, without reintroducing the duplicate serialized field.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants