Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 24, 2025

概述

根据微信支付2024年12月更新,为"平台预约提现"和"二级商户预约提现"接口新增了 notify_url 回调参数支持,并新增了提现状态变更回调处理功能。

变更内容

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_SUCCESSSUCCESSFAILEDREFUNDCLOSE
  • 包含完整的提现信息:商户单号、微信单号、金额、时间、失败原因等

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. 文档更新

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

兼容性

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

相关Issue

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

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.

… callback

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] 微信支付(平台收付通)的“平台预约提现”接口新增回调参数 feat: 微信支付(平台收付通)提现接口新增回调参数支持 Sep 24, 2025
@Copilot 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
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