Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 28, 2025

V3 API 服务商模式缺少退款申请方法,用户使用服务商下单后调用退款会报错"受理机构必须传入sub_mch_id"。

变更内容

  • WxPayService.java: 新增 partnerRefundV3(WxPayPartnerRefundV3Request) 接口方法
  • BaseWxPayServiceImpl.java: 实现服务商退款,自动从配置读取 subMchId

使用示例

WxPayPartnerRefundV3Request request = new WxPayPartnerRefundV3Request();
request.setTransactionId("微信订单号");
request.setOutRefundNo("商户退款单号");
request.setSubMchid("子商户号");  // 可选,未设置则从配置读取
// ... 设置其他参数

WxPayRefundV3Result result = wxPayService.partnerRefundV3(request);

服务商 V3 功能完整性

功能 方法
统一下单 createPartnerOrderV3 / unifiedPartnerOrderV3
订单查询 queryPartnerOrderV3
关闭订单 closePartnerOrderV3
退款申请 partnerRefundV3 ✨ 本次新增
退款查询 refundPartnerQueryV3
Original prompt

This section details on the original issue you should resolve

<issue_title>4.7.8 V3 什么时候可以支持服务商模式下单</issue_title>
<issue_description>目前最新版本4.7.8 V2支持服务商统一下单,但V3并不支持,请问有计划支持下么,WxPayOrderQueryV3Request并不包含subMrcId 和subappid,而v2 的WxPayOrderQueryRequest 只有的,我在V2上下单成功,V3会报错:

Caused by: com.github.binarywang.wxpay.exception.WxPayException: 受理机构必须传入sub_mch_id --

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

Custom agent used: 自定义的
需要用中文


💡 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 support for service provider ordering in V3 添加 V3 服务商退款方法 partnerRefundV3 Nov 28, 2025
Copilot AI requested a review from binarywang November 28, 2025 02:11
@binarywang binarywang marked this pull request as ready for review November 28, 2025 03:25
@binarywang binarywang merged commit c4f3834 into develop Nov 28, 2025
1 check passed
@binarywang binarywang deleted the copilot/support-service-provider-order-v3 branch November 28, 2025 03:26
@binarywang binarywang added this to the 4.7.9 milestone Nov 28, 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.

4.7.8 V3 什么时候可以支持服务商模式下单

2 participants