Skip to content

feat(pay): 支持连锁品牌入驻、门店管理和分账 - #4139

Open
binarywang wants to merge 2 commits into
developfrom
feat/3972-chain-brand
Open

binarywang wants to merge 2 commits into
developfrom
feat/3972-chain-brand

Conversation

@binarywang

@binarywang binarywang commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

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

Copilot AI balanced review requested due to automatic review settings October 13, 2026 08:56

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

Copy link
Copy Markdown

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: 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".

Comment thread docs/WECHAT_PAY_CHAIN_BRAND_USAGE.md Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T09:03:14.114952Z 6512b71 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@augmentcode

augmentcode Bot commented Oct 13, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

摘要:补齐微信支付服务商模式下的连锁品牌接口,覆盖品牌入驻、门店管理和分账。

  • 新增三个独立服务,与普通分账及品牌红包转账区分。
  • 品牌入驻支持提交、撤销及按两类申请编号查询。
  • 门店管理支持创建、查询、更新、删除以及绑定、解绑收款商户号。
  • 品牌分账支持请求、查询、回退、完结及接收方管理等九项操作。
  • 新增对应请求、响应模型和微信字段映射。
  • 通过 WxPayService 提供入口,并在基础实现中缓存服务实例。
  • 发送前复制请求并加密敏感字段,保留调用方明文以支持重试。
  • 复用现有分账通知验签与 AES-GCM 解密逻辑,并拒绝空签名头。
  • 门店删除使用携带 JSON 请求体的 DELETE 请求;未新增依赖。
  • 添加离线契约、加密、通知及服务入口测试,并补充调用文档。
    审查结论:静态审查及官方接口文档核对未发现实质性缺陷;本次未执行测试或真实接口联调。

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

Copilot stopped reviewing on behalf of binarywang due to an error October 13, 2026 09:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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, and BrandProfitSharingService APIs with corresponding impls and request/response beans.
  • Wires the new services into WxPayService (default methods) and BaseWxPayServiceImpl (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.

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.

微信支付功能增加对支付品牌的支持

2 participants