GeezerVison is showing github.com — 修复:微信委托代扣协议字段名 contract_termination_mode 拼写错误 by Copilot · Pull Request #3813 · binarywang/WxJava
Conversation
Copilot
AI
commented
Dec 19, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
WxSignQueryResult 中"协议解约方式"字段名与微信官方文档不一致。文档规定字段名为 contract_termination_mode,代码中误写为 contract_terminated_mode。
修改内容
- XStream 注解:
@XStreamAlias("contract_terminated_mode") → @XStreamAlias("contract_termination_mode")
- XML 解析:
readXmlInteger(d, "contract_terminate_mode") → readXmlInteger(d, "contract_termination_mode")
修复前后对比:
// 修复前
@XStreamAlias("contract_terminated_mode")
private Integer contractTerminatedMode;
protected void loadXml(Document d) {
contractTerminatedMode = readXmlInteger(d, "contract_terminate_mode");
}
// 修复后
@XStreamAlias("contract_termination_mode")
private Integer contractTerminatedMode;
protected void loadXml(Document d) {
contractTerminatedMode = readXmlInteger(d, "contract_termination_mode");
}
参考文档:
Original prompt
This section details on the original issue you should resolve
<issue_title>微信委托代扣协议结果 contract_terminated_mode 字段名错误</issue_title>
<issue_description>### 简要描述
com.github.binarywang.wxpay.bean.result.WxSignQueryResult 中 "协议解约方式" 字段的字段名, 并非 contract_terminated_mode , 而是 contract_termination_mode .
代码参见:
|
/** |
|
* 协议解约方式 |
|
* 非必传 |
|
*/ |
|
@XStreamAlias("contract_terminated_mode") |
|
private Integer contractTerminatedMode; |
微信支付文档参见:
签约、解约结果通知 与 查询签约关系
模块版本情况
- WxJava 模块名: weixin-java-pay
- WxJava 版本号: 4.7.9.B
</issue_description>
Comments on the Issue (you are @copilot in this section)
Custom agent used: 全部用中文
需要用中文,包括PR标题和分析总结过程
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Copilot
AI
changed the title
[WIP] Fix contract terminated mode field name in WxSignQueryResult
修复:微信委托代扣协议字段名 contract_termination_mode 拼写错误
Dec 19, 2025
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
此 PR 修复了微信委托代扣协议结果类 WxSignQueryResult 中"协议解约方式"字段名的拼写错误,使其与微信官方文档一致。原代码中使用了错误的字段名,导致无法正确解析微信 API 返回的 XML 数据。
主要变更:
- 将 XStream 注解从
contract_terminated_mode 更正为 contract_termination_mode
- 将 XML 解析方法调用从
contract_terminate_mode 更正为 contract_termination_mode
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
binarywang
Awaiting requested review from binarywang
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.