From 5117caf920921649c46653680e1fec06ad5f629e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9B=9B=E5=8F=B6=E8=8D=89?= <362692680@qq.com> Date: Thu, 3 Aug 2023 18:27:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=8D=95=E7=AC=94=E9=80=80=E6=AC=BEv3=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=95=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bean/request/WxPayRefundQueryV3Request.java | 12 ++++++++++++ .../binarywang/wxpay/service/WxPayService.java | 17 ++++++++++++++++- .../service/impl/BaseWxPayServiceImpl.java | 7 +++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayRefundQueryV3Request.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayRefundQueryV3Request.java index e7d34e31f..977ca9ce5 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayRefundQueryV3Request.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayRefundQueryV3Request.java @@ -29,4 +29,16 @@ public class WxPayRefundQueryV3Request implements Serializable { */ @SerializedName(value = "out_refund_no") private String outRefundNo; + /** + *
+   * 字段名:子商户号
+   * 变量名:sub_mchid
+   * 是否必填:是
+   * 类型:string[1, 32]
+   * 描述:子商户的商户号,由微信支付生成并下发。
+   * 示例值:1900000109
+   * 
+ */ + @SerializedName(value = "sub_mchid") + private String subMchid; } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java index 4384f46fa..25150d1c8 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java @@ -868,7 +868,7 @@ public interface WxPayService { /** *
-   * 微信支付-查询退款
+   * 微信支付-查询退款-直连商户
    * 应用场景:
    *  提交退款申请后,通过调用该接口查询退款状态。退款有一定延时,建议在提交退款申请后1分钟发起查询退款状态,一般来说零钱支付的退款5分钟内到账,银行卡支付的退款1-3个工作日到账。
    *  详见 https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_10.shtml
@@ -881,6 +881,21 @@ public interface WxPayService {
    */
   WxPayRefundQueryV3Result refundQueryV3(WxPayRefundQueryV3Request request) throws WxPayException;
 
+  /**
+   * 
+   * 微信支付-查询退款-服务商
+   * 应用场景:
+   *  提交退款申请后,通过调用该接口查询退款状态。退款有一定延时,建议在提交退款申请后1分钟发起查询退款状态,一般来说零钱支付的退款5分钟内到账,银行卡支付的退款1-3个工作日到账。
+   *  详见 https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter4_1_10.shtml
+   * 接口链接:https://api.mch.weixin.qq.com/v3/refund/domestic/refunds/{out_refund_no}?sub_mchid={sub_mchid}
+   * 
+ * + * @param request 微信退款单号 + * @return 退款信息 wx pay refund query result + * @throws WxPayException the wx pay exception + */ + WxPayRefundQueryV3Result refundQueryV3Isv(WxPayRefundQueryV3Request request) throws WxPayException; + /** * 解析支付结果通知. * 详见https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_7 diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java index 694fcb768..e8e296cbc 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java @@ -298,6 +298,13 @@ public abstract class BaseWxPayServiceImpl implements WxPayService { return GSON.fromJson(response, WxPayRefundQueryV3Result.class); } + @Override + public WxPayRefundQueryV3Result refundQueryV3Isv(WxPayRefundQueryV3Request request) throws WxPayException { + String url = String.format("%s/v3/refund/domestic/refunds/%s?sub_mchid=%s", this.getPayBaseUrl(), request.getOutRefundNo(),request.getSubMchid()); + String response = this.getV3(url); + return GSON.fromJson(response, WxPayRefundQueryV3Result.class); + } + @Override public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData) throws WxPayException { return this.parseOrderNotifyResult(xmlData, null); -- Gitee From 9d2dc0efdec3f3a1dee020a7d76137854f01063a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9B=9B=E5=8F=B6=E8=8D=89?= <362692680@qq.com> Date: Thu, 3 Aug 2023 18:41:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=95=86=E6=9F=A5=E8=AF=A2=E5=8D=95=E7=AC=94=E9=80=80=E6=AC=BE?= =?UTF-8?q?v3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/github/binarywang/wxpay/service/WxPayService.java | 2 +- .../binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java index 25150d1c8..2bddaa975 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java @@ -894,7 +894,7 @@ public interface WxPayService { * @return 退款信息 wx pay refund query result * @throws WxPayException the wx pay exception */ - WxPayRefundQueryV3Result refundQueryV3Isv(WxPayRefundQueryV3Request request) throws WxPayException; + WxPayRefundQueryV3Result refundPartnerQueryV3(WxPayRefundQueryV3Request request) throws WxPayException; /** * 解析支付结果通知. diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java index e8e296cbc..0e5579f1b 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java @@ -299,7 +299,7 @@ public abstract class BaseWxPayServiceImpl implements WxPayService { } @Override - public WxPayRefundQueryV3Result refundQueryV3Isv(WxPayRefundQueryV3Request request) throws WxPayException { + public WxPayRefundQueryV3Result refundPartnerQueryV3(WxPayRefundQueryV3Request request) throws WxPayException { String url = String.format("%s/v3/refund/domestic/refunds/%s?sub_mchid=%s", this.getPayBaseUrl(), request.getOutRefundNo(),request.getSubMchid()); String response = this.getV3(url); return GSON.fromJson(response, WxPayRefundQueryV3Result.class); -- Gitee