-
-
Notifications
You must be signed in to change notification settings - Fork 9k
新增微工卡批量转账API支持 #3862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
新增微工卡批量转账API支持 #3862
Conversation
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
🤖 Augment PR SummarySummary: 本 PR 为微信支付 V3「微工卡」补充了此前缺失的批量转账接口支持,覆盖服务商场景下的 Changes:
Technical Notes: 敏感字段(如明细中的 🤖 Was this summary useful? React with 👍 or 👎 |
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.
Review completed. No suggestions at this time.
Comment augment review to trigger a new review at any time.
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 为微信支付 SDK 新增了微工卡批量转账 API 支持,补充了官方文档中存在但在 4.8.0 版本及之前缺失的 /v3/payroll-card/transfer-batches 接口。
Changes:
- 新增
PayrollTransferBatchesRequest和PayrollTransferBatchesResult两个数据模型类,支持批量转账请求和响应 - 在
PayrollService接口和PayrollServiceImpl实现类中添加payrollCardTransferBatches方法 - 添加相应的单元测试用例到
PayrollServiceImplTest
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| PayrollTransferBatchesRequest.java | 新增批量转账请求模型,包含批次信息和转账明细列表,userName 字段使用 @SpecEncrypt 注解支持自动加密 |
| PayrollTransferBatchesResult.java | 新增批量转账响应模型,包含批次状态、金额统计等完整的返回字段 |
| PayrollService.java | 在服务接口中新增 payrollCardTransferBatches 方法定义 |
| PayrollServiceImpl.java | 实现批量转账方法,包含敏感信息加密处理和 V3 API 调用 |
| PayrollServiceImplTest.java | 新增测试用例验证批量转账功能 |
| if (StringUtils.isNotEmpty(detail.getUserName())) { | ||
| RsaCryptoUtil.encryptFields(detail, payService.getConfig().getVerifier().getValidCertificate()); | ||
| } |
Copilot
AI
Jan 19, 2026
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.
在 PayrollServiceImpl.payrollCardTransferBatches 方法中,对 userName 的 null/empty 检查是冗余的。RsaCryptoUtil.encryptFields 方法内部已经处理了 null 和空字符串的检查(参见 RsaCryptoUtil.java 第 66-72 行)。
建议简化代码,与 TransferServiceImpl.transferBatches 保持一致的模式(第 33-34 行),直接对所有 detail 调用 encryptFields,无需额外的 null 检查:
for (PayrollTransferBatchesRequest.TransferDetail detail : request.getTransferDetailList()) {
RsaCryptoUtil.encryptFields(detail, payService.getConfig().getVerifier().getValidCertificate());
}这样可以提高代码一致性并减少不必要的检查。
| if (StringUtils.isNotEmpty(detail.getUserName())) { | |
| RsaCryptoUtil.encryptFields(detail, payService.getConfig().getVerifier().getValidCertificate()); | |
| } | |
| RsaCryptoUtil.encryptFields(detail, payService.getConfig().getVerifier().getValidCertificate()); |
补充微信支付官方微工卡批量转账接口
/v3/payroll-card/transfer-batches,该接口在 4.8.0 及之前版本中缺失。变更内容
新增请求/响应模型
PayrollTransferBatchesRequest: 批量转账请求参数,支持最多 1000 笔明细PayrollTransferBatchesResult: 批次状态、金额统计等返回信息扩展 PayrollService
payrollCardTransferBatches()方法RsaCryptoUtil.encryptFields()自动处理@SpecEncrypt注解字段加密,与TransferService实现保持一致单元测试
PayrollServiceImplTest中新增测试用例使用示例
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.