Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 19, 2026

微信支付转账到银行卡的查询接口返回 bank_namebank_card_number_tail 字段,但 BatchDetailsResult 实体类缺少对应的属性映射,导致这些数据丢失。

变更内容

  • BatchDetailsResult.java: 添加 bankNamebankCardNumberTail 字段

    • 使用 @SerializedName 映射 API 返回的 bank_namebank_card_number_tail
    • 标记为可选字段(仅转账到银行卡场景返回)
  • BatchDetailsResultTest.java: 新增单元测试

    • 验证包含/不包含银行字段的反序列化
    • 覆盖序列化、特殊字符处理等场景

使用示例

BatchDetailsResult result = wxPayService.getPartnerTransferService()
    .queryBatchDetailByMch(outBatchNo, outDetailNo);

// 现在可以获取银行信息
String bankName = result.getBankName();  // "中国农业银行股份有限公司深圳分行"
String cardTail = result.getBankCardNumberTail();  // "1234"

转账到零钱场景下这两个字段为 null

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • gitee.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
  • wx.gtimg.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>BatchDetailsResult实体类里面没有bankName与bankCardNumberTail字段</issue_title>
<issue_description>原始需求来自:https://gitee.com/binary/weixin-java-tools/issues/IDJWCT

wxPayService.getPartnerTransferService().queryBatchDetailByMch这个方法返回的BatchDetailsResult实体类里面没有bankName与bankCardNumberTail字段,这个在官方接口返回是有这两个重要字段的,可是BatchDetailsResult实体类里面没有。</issue_description>

Comments on the Issue (you are @copilot in this section)

Custom agent used: 全部用中文
需要用中文,包括PR标题和分析总结过程


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Copilot AI changed the title [WIP] Add bankName and bankCardNumberTail fields to BatchDetailsResult 添加 BatchDetailsResult 的 bankName 和 bankCardNumberTail 字段 Jan 19, 2026
Copilot AI requested a review from binarywang January 19, 2026 03:47
@binarywang binarywang marked this pull request as ready for review January 19, 2026 03:47
Copilot AI review requested due to automatic review settings January 19, 2026 03:47
@augmentcode
Copy link

augmentcode bot commented Jan 19, 2026

🤖 Augment PR Summary

Summary: 本 PR 补齐微信支付“转账到银行卡”明细查询接口返回字段在 BatchDetailsResult 中的映射,避免返回数据丢失。

Changes:

  • BatchDetailsResult 中新增 bankNamebankCardNumberTail 两个可选字段
  • 使用 @SerializedName 映射微信侧返回的 bank_namebank_card_number_tail
  • 新增 BatchDetailsResultTest,覆盖包含/不包含银行字段的反序列化
  • 测试覆盖序列化时银行字段输出、toString() 输出包含银行字段
  • 补充银行名称含特殊字符及失败场景下银行字段为空的用例

Technical Notes: 新增字段仅在“转账到银行卡”场景返回;对“转账到零钱”等不返回该字段的场景保持为 null

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a 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.

Copy link

Copilot AI left a 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 为 BatchDetailsResult 实体类添加了微信支付 API 返回的银行相关字段,解决了转账到银行卡场景下关键信息丢失的问题。

Changes:

  • BatchDetailsResult 类中添加 bankName(开户银行全称)和 bankCardNumberTail(银行卡号后四位)两个可选字段
  • 使用 @SerializedName 注解正确映射 API 返回的 bank_namebank_card_number_tail
  • 新增完整的单元测试用例,覆盖包含/不包含银行字段、序列化、特殊字符等多种场景

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
BatchDetailsResult.java 添加 bankName 和 bankCardNumberTail 两个私有字段,使用 @SerializedName 注解进行 JSON 映射,并添加完整的 JavaDoc 文档说明字段用途、类型和示例值
BatchDetailsResultTest.java 新增测试类,包含 5 个测试方法验证新字段的反序列化、序列化、toString、特殊字符处理和失败场景,测试覆盖全面

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.

BatchDetailsResult实体类里面没有bankName与bankCardNumberTail字段

2 participants