GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: 微信支付(平台收付通)提现接口新增回调参数支持及补充日终余额提现API by Copilot · Pull Request #3721 · binarywang/WxJava

Conversation

Copilot AI commented Sep 24, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

概述

根据微信支付2024年12月更新,为"平台预约提现"和"二级商户预约提现"接口新增了 notify_url 回调参数支持,并新增了提现状态变更回调处理功能。同时补充了日终余额提现相关API和平台按微信单号查询提现状态的接口。

变更内容

1. 新增回调通知地址参数

SubWithdrawRequest(二级商户预约提现)

SubWithdrawRequest request = new SubWithdrawRequest();
request.setSubMchid("1900000109");
request.setOutRequestNo("20241224001");
request.setAmount(10000);
// 新增:设置回调通知地址
request.setNotifyUrl("https://your-domain.com/notify/withdraw");

SpWithdrawRequest(平台预约提现)

SpWithdrawRequest request = new SpWithdrawRequest();
request.setOutRequestNo("20241224002");
request.setAmount(50000);
request.setAccountType("BASIC");
// 新增:设置回调通知地址
request.setNotifyUrl("https://your-domain.com/notify/sp-withdraw");

2. 新增提现状态变更回调支持

WithdrawNotifyResult(提现状态变更通知结果)

  • 新增专门的回调数据处理类
  • 支持所有提现状态:CREATE_SUCCESS、SUCCESS、FAILED、REFUND、CLOSE
  • 包含完整的提现信息:商户单号、微信单号、金额、时间、失败原因等
  • 支持日终余额提现回调字段:solution、account_name、account_number、bank_name

EcommerceService接口扩展

// 新增方法
WithdrawNotifyResult parseWithdrawNotifyResult(String notifyData, SignatureHeader header) throws WxPayException;

使用示例

// 处理提现状态变更回调
WithdrawNotifyResult notifyResult = ecommerceService.parseWithdrawNotifyResult(notifyData, header);
String status = notifyResult.getStatus();
String outRequestNo = notifyResult.getOutRequestNo();

switch (status) {
    case "SUCCESS":
        System.out.println("提现成功:" + outRequestNo);
        break;
    case "FAILED":
        System.out.println("提现失败:" + outRequestNo + ",原因:" + notifyResult.getReason());
        break;
    // 其他状态处理...
}

3. 新增日终余额提现API

二级商户按日终余额预约提现

SubDayEndBalanceWithdrawRequest request = new SubDayEndBalanceWithdrawRequest();
request.setSubMchid("1900000109");
request.setOutRequestNo("20241224003");
request.setAmount(10000);
request.setAccountType("BASIC");
request.setNotifyUrl("https://your-domain.com/notify/balance-withdraw");

SubDayEndBalanceWithdrawResult result = ecommerceService.subDayEndBalanceWithdraw(request);

查询二级商户按日终余额预约提现状态

SubDayEndBalanceWithdrawStatusResult status = 
    ecommerceService.querySubDayEndBalanceWithdraw("1900000109", "20241224003");

4. 新增平台按微信单号查询提现状态

// 根据微信支付提现单号查询平台提现状态
SpWithdrawStatusResult status = ecommerceService.querySpWithdrawByWithdrawId("12321002198704230011101200");

5. 文档更新

更新了所有相关方法的javadoc注释,使用最新的官方文档地址:

  • 平台预约提现接口:https://pay.weixin.qq.com/doc/v3/partner/4012476670
  • 二级商户预约提现接口:https://pay.weixin.qq.com/doc/v3/partner/4012476652
  • 商户提现状态变更回调:https://pay.weixin.qq.com/doc/v3/partner/4013049135
  • 平台查询预约提现状态(根据微信支付预约提现单号查询):https://pay.weixin.qq.com/doc/v3/partner/4012476674
  • 二级商户按日终余额预约提现:https://pay.weixin.qq.com/doc/v3/partner/4013328143
  • 查询二级商户按日终余额预约提现状态:https://pay.weixin.qq.com/doc/v3/partner/4013328163

兼容性

  • ✅ 完全向后兼容:notify_url 参数为可选,现有代码无需修改
  • ✅ 遵循现有模式:回调解析方法与现有 parseRefundNotifyResult 保持一致的实现模式
  • ✅ 代码质量保证:通过checkstyle检查,符合项目代码规范

相关Issue

Closes #3494 - 微信支付(平台收付通)的"平台预约提现"接口新增回调参数

Fixes #3494


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Initial plan
1c5596c
Copilot AI assigned Copilot and binarywang Sep 24, 2025
Copilot started work on behalf of binarywang September 24, 2025 15:12
View session
@binarywang
Update WeChat Pay withdrawal APIs to support notify_url parameter and…
32779b1
… callback

Co-authored-by: binarywang <[email protected]>
Copilot AI changed the title [WIP] 微信支付(平台收付通)的“平台预约提现”接口新增回调参数 feat: 微信支付(平台收付通)提现接口新增回调参数支持 Sep 24, 2025
Copilot AI requested a review from binarywang September 24, 2025 15:25
Copilot finished work on behalf of binarywang September 24, 2025 15:25
@binarywang binarywang added this to the 4.7.9 milestone Sep 27, 2025
@imyzt

imyzt commented Oct 15, 2025

Copy link
Copy Markdown
Contributor

@binarywang 我们@不了 @copilot

issue 提到的接口不全,建议一次性将微信支付新增的以下接口补全:

  1. 查询二级商户按日终余额预约提现状态
  2. 二级商户按日终余额预约提现
  3. 平台查询预约提现状态(根据微信支付预约提现单号查询)

需要注意,因为 “商户提现状态变更回调” 不止 平台预约提现接口 和 二级商户预约提现接口 使用,二级商户按日终余额预约提现 也会使用,所以 WithdrawNotifyResult 需要补充字段。

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@binarywang
binarywang marked this pull request as ready for review October 23, 2025 03:20
@binarywang

binarywang commented Oct 23, 2025

Copy link
Copy Markdown
Owner

@binarywang 我们@不了 @copilot

issue 提到的接口不全,建议一次性将微信支付新增的以下接口补全:

  1. 查询二级商户按日终余额预约提现状态
  2. 二级商户按日终余额预约提现
  3. 平台查询预约提现状态(根据微信支付预约提现单号查询)

需要注意,因为 “商户提现状态变更回调” 不止 平台预约提现接口 和 二级商户预约提现接口 使用,二级商户按日终余额预约提现 也会使用,所以 WithdrawNotifyResult 需要补充字段。

@copilot 请注意下这些问题

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot started work on behalf of binarywang October 23, 2025 06:45
View session
@binarywang
Add missing withdrawal APIs and update WithdrawNotifyResult with addi…
41715ea
…tional fields

Co-authored-by: binarywang <[email protected]>

Copilot AI commented Oct 23, 2025

Copy link
Copy Markdown
Contributor Author

@binarywang 我们@不了 @copilot

issue 提到的接口不全,建议一次性将微信支付新增的以下接口补全:
...

已完成所有补充接口的实现,详见提交 41715ea:

  1. ✅ 平台查询预约提现状态(根据微信支付预约提现单号查询)- querySpWithdrawByWithdrawId()
  2. ✅ 二级商户按日终余额预约提现 - subDayEndBalanceWithdraw()
  3. ✅ 查询二级商户按日终余额预约提现状态 - querySubDayEndBalanceWithdraw()
  4. ✅ WithdrawNotifyResult 已补充字段:solution, account_name, account_number, bank_name

所有接口遵循现有代码规范,通过编译和checkstyle验证。

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot AI changed the title feat: 微信支付(平台收付通)提现接口新增回调参数支持 feat: 微信支付(平台收付通)提现接口新增回调参数支持及补充日终余额提现API Oct 23, 2025
Copilot finished work on behalf of binarywang October 23, 2025 06:54
@binarywang
binarywang merged commit d4186c4 into develop Nov 5, 2025
1 check passed

Uh oh!

There was an error while loading. Please reload this page.

@binarywang
binarywang deleted the copilot/fix-630d7860-2a00-409b-ae6e-cf5ed9ab4601 branch November 5, 2025 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@binarywang binarywang Awaiting requested review from binarywang

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@binarywang binarywang

Copilot code review Copilot

Labels

None yet

Projects

None yet

Milestone

4.7.9

Development

Successfully merging this pull request may close these issues.

微信支付(平台收付通)的“平台预约提现”接口新增回调参数

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@imyzt @binarywang
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.