feat: 兼容收付通旧版下单模型 - #4087
Conversation
🤖 Augment PR Summary摘要:本 PR 旨在恢复 #4014 删除的收付通旧版公开 API,降低 4.8.4 应用升级至 4.8.5.B 的编译兼容风险。
🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Pull request overview
该 PR 旨在为微信支付「电商收付通」在 #4014 统一模型之后提供旧版公开类型与入口的过渡兼容层:恢复 bean.ecommerce 下旧模型(标记 @Deprecated),并在 EcommerceService 中提供旧签名入口以便存量应用可升级到包含新能力的版本,同时不改变统一 API 的实现路径。
Changes:
- 恢复一批
com.github.binarywang.wxpay.bean.ecommerce旧模型/枚举并标记为@Deprecated,用于源码级兼容。 - 在
EcommerceService增加旧版combine(...)默认方法入口,内部转换为统一模型并委托现有实现。 - 新增编译兼容性测试与设计/计划文档,说明过渡兼容策略。
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/LegacyEcommerceApiCompatibilityTest.java | 新增编译级兼容性测试,确保旧类型可被引用/通过编译 |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java | 调整 combine/combineTransactions 参数类型引用以避免与旧包同名类型冲突 |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java | 新增旧版 combine 入口(Deprecated),并调整统一入口参数类型引用 |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/TransactionsResult.java | 恢复旧版 TransactionsResult(Deprecated)用于旧调用方返回类型兼容 |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SignatureHeader.java | 恢复旧版通知签名头模型(Deprecated) |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsResult.java | 恢复旧版普通支付查询结果模型(Deprecated) |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsRequest.java | 恢复旧版普通支付下单请求模型(Deprecated) |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsQueryRequest.java | 恢复旧版普通支付查询请求模型(Deprecated) |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsNotifyResult.java | 恢复旧版普通支付通知结果模型(Deprecated) |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsCloseRequest.java | 恢复旧版普通支付关单请求模型(Deprecated) |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/enums/TradeTypeEnum.java | 恢复旧版交易类型枚举(Deprecated) |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/CombineTransactionsResult.java | 恢复旧版合单查询结果模型(Deprecated) |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/CombineTransactionsRequest.java | 恢复旧版合单下单请求模型(Deprecated) |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/CombineTransactionsNotifyResult.java | 恢复旧版合单通知结果模型(Deprecated) |
| docs/superpowers/specs/2026-08-08-legacy-ecommerce-api-compatibility-design.md | 新增兼容层设计说明文档 |
| docs/superpowers/plans/2026-08-08-legacy-ecommerce-api-compatibility.md | 新增实现计划文档 |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c49ca851ef
ℹ️ 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".
背景
#4014 统一收付通下单模型时移除了
bean.ecommerce下的公开类型,导致仍使用TransactionsResult等旧 API 的应用无法直接升级到包含服务商电子发票能力的 4.8.5.B。变更
@DeprecatedEcommerceService#combine调用入口,内部转换为统一模型并委托当前实现迁移与后续
旧 API 将保留至 5.0;新代码应继续使用统一的
bean.request、bean.result和bean.notify模型。验证
mvn -pl weixin-java-pay -Dtest=LegacyEcommerceApiCompatibilityTest testgit diff --check注:模块当前 Surefire 配置会跳过测试执行;上述命令已完成生产代码和测试代码编译。