Repository navigation
feat(pay): 支持连锁品牌入驻、门店管理和分账 - #4139
binarywang wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6512b7184e
ℹ️ 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".
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🤖 Augment PR Summary摘要:补齐微信支付服务商模式下的连锁品牌接口,覆盖品牌入驻、门店管理和分账。
🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Note
Copilot was unable to run its full agentic suite in this review.
Copilot review overview
1 open finding
What changed in this PR
Adds offline contract coverage and production implementations for WeChat Pay “chain brand” capabilities (brand applyment, brand store management, and chain-brand profit sharing), plus documentation and service entrypoints.
Changes:
- Introduces new
BrandApplymentService,BrandStoreService, andBrandProfitSharingServiceAPIs with corresponding impls and request/response beans. - Wires the new services into
WxPayService(default methods) andBaseWxPayServiceImpl(cached getters). - Adds TestNG offline contract tests and a usage guide doc.
| File | Description |
|---|---|
| weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/BrandStoreServiceTest.java | Adds offline contract tests for brand store CRUD + recipient binding/unbinding. |
| weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/BrandServiceEntryTest.java | Verifies service entrypoints are exposed across supported WxPayService implementations. |
| weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/BrandProfitSharingServiceTest.java | Adds offline contract tests for chain-brand profit sharing routes, encryption, and notify parsing. |
| weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/BrandApplymentServiceTest.java | Adds offline contract tests for brand applyment encryption, routing, and error propagation. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BrandStoreServiceImpl.java | Implements brand store API calls, including DELETE-with-body support. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BrandProfitSharingServiceImpl.java | Implements chain-brand profit sharing APIs, including field encryption and notify parsing delegation. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BrandApplymentServiceImpl.java | Implements brand applyment APIs, including request encryption without mutating caller objects. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java | Adds cached getters for the new brand services. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java | Adds default interface methods to access the new brand services for compatibility. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/BrandStoreService.java | Declares brand store service API. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/BrandProfitSharingService.java | Declares chain-brand profit sharing service API. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/BrandApplymentService.java | Declares brand applyment service API. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandstore/BrandStoreUnbindRecipientResult.java | Adds unbind-recipient response model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandstore/BrandStoreUnbindRecipientRequest.java | Adds unbind-recipient request model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandstore/BrandStoreResult.java | Adds store create/query/update response model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandstore/BrandStoreRequest.java | Adds store create/update request model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandstore/BrandStoreRecipient.java | Adds bound-recipient model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandstore/BrandStoreBusiness.java | Adds store business info model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandstore/BrandStoreBindRecipientResult.java | Adds bind-recipient response model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandstore/BrandStoreBindRecipientRequest.java | Adds bind-recipient request model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandstore/BrandStoreBasics.java | Adds store basics model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandstore/BrandStoreAddress.java | Adds store address model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandprofitsharing/BrandProfitSharingReturnResult.java | Adds profit sharing return response model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandprofitsharing/BrandProfitSharingReturnRequest.java | Adds profit sharing return request model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandprofitsharing/BrandProfitSharingReturnQueryRequest.java | Adds profit sharing return query request model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandprofitsharing/BrandProfitSharingResult.java | Adds profit sharing query/result model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandprofitsharing/BrandProfitSharingRequest.java | Adds profit sharing create request model with encrypted fields. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandprofitsharing/BrandProfitSharingReceiverResult.java | Adds receiver add/delete result model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandprofitsharing/BrandProfitSharingReceiverRequest.java | Adds receiver add request model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandprofitsharing/BrandProfitSharingReceiverDeleteRequest.java | Adds receiver delete request model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandprofitsharing/BrandProfitSharingRatioResult.java | Adds max ratio response model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandprofitsharing/BrandProfitSharingQueryRequest.java | Adds profit sharing query request model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandprofitsharing/BrandProfitSharingFinishResult.java | Adds finish response model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandprofitsharing/BrandProfitSharingFinishRequest.java | Adds finish request model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandprofitsharing/BrandProfitSharingAmountResult.java | Adds remaining-amount response model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandapplyment/BrandApplymentResult.java | Adds brand applyment create/cancel response model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandapplyment/BrandApplymentRequest.java | Adds brand applyment request model with encrypted fields. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandapplyment/BrandApplymentQueryResult.java | Adds brand applyment status response model. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/brandapplyment/BrandApplymentCancelRequest.java | Adds brand applyment cancel request model. |
| docs/WECHAT_PAY_CHAIN_BRAND_USAGE.md | Adds end-user documentation for accessing and using the new services. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

WxJava 尚未封装服务商模式下的连锁品牌接口。此 PR 增加品牌入驻(4 项)、门店管理(6 项)和连锁品牌分账(9 项)三个独立服务,支持分账通知验签与解密,并通过 WxPayService 提供入口。
敏感字段自动加密且不修改调用方请求,允许使用同一对象重试。门店删除保留官方要求的 JSON 请求体;保持 Java 8 兼容,无新增依赖,原普通分账和品牌红包行为保持不变。附带调用文档。
验证:新增及相关回归测试共 53 项通过,零失败、零跳过;git diff --check 通过;独立代码审查通过。测试覆盖 HTTP 方法/路径、字段映射、RSA 加密、AES-GCM 通知解密及签名拒绝。真实微信接口联调尚未执行,需要已开通品牌权限的服务商账号。
测试命令:
mvn -pl weixin-java-pay -am -Dmaven.test.skip=false -DskipTests=false -Dtest=BrandApplymentServiceTest,BrandStoreServiceTest,BrandProfitSharingServiceTest,BrandServiceEntryTest,PartnerInvoiceServiceImplTest,TransferAuthorizationApiCompatibilityTest,TransferUserAuthorizationApiCompatibilityTest,TransferReceiptApiCompatibilityTest -Dsurefire.failIfNoSpecifiedTests=false test补充审查修复:Jodd 品牌入口明确拒绝不支持的 APIv3;品牌测试加入默认 TestNG 套件;示例使用合法编号;品牌请求及签名组件不再记录敏感正文、异常正文或 Authorization。
最终验证(未指定
-Dtest):mvn -pl weixin-java-pay -am -Dmaven.test.skip=false -DskipTests=false test公共模块 28 项、支付模块 213 项通过,零失败、零跳过。新增日志回归测试覆盖两客户端成功/失败、代理路径前缀及 DEBUG 签名链路。
Closes #3972