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 e7d34e31f9232916ca1856c200b9c1be56464ffd..977ca9ce52d6ff743bd937de1dc7e85e96df9761 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 4384f46fa74a21087b495c34b64f712b4507de51..25150d1c8b79c9fa3591100a2feca6ee57d76d25 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 694fcb768709533279c0e10a7e50c3d6a5741a0a..e8e296cbcab8ec0c306540a625e2697cc0b30ea9 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);