fix: 小程序纯签约移除version参数#4073
Conversation
cofedream
commented
Jul 20, 2026
- 纯小程序签约无version参数,使用该参数生成的签名在跳转签约的时候会提示“商家系统错误”
1. 纯小程序签约无version参数,新增该参数会导致生成的签名错误
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46e7e1297f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| private String version; | ||
|
|
||
|
|
||
| /** |
There was a problem hiding this comment.
🤖 Augment PR SummarySummary: 修复微信支付小程序纯签约场景不应携带 Changes: 移除 🤖 Was this summary useful? React with 👍 or 👎 |
| */ | ||
| @Required | ||
| @XStreamAlias("version") | ||
| private String version; |
There was a problem hiding this comment.
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxMaEntrustRequest.java:115
这里直接移除了 version 字段(@Data/@Builder 会对外暴露 getVersion/setVersion 及 builder 方法),对下游源码/二进制兼容是破坏性的;建议在发布说明/升级指引中明确该不兼容变更的影响范围。
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| * </pre> | ||
| */ | ||
| @Required | ||
| @XStreamAlias("version") |
There was a problem hiding this comment.
|
建议不要直接删除 可考虑: @Deprecated
@XStreamOmitField
private transient String version;
@Override
protected String[] getIgnoredParamsForSign() {
return new String[]{"version"};
}原因是:仅在签名时忽略 建议补一个回归测试:显式设置 |