From 80835bcc12f4788c1a88da61e623b362e57f1cb1 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期六, 24 八月 2024 09:31:43 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
---
ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/wx/utils/WxV3Pay.java | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/wx/utils/WxV3Pay.java b/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/wx/utils/WxV3Pay.java
index 2768601..4e01120 100644
--- a/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/wx/utils/WxV3Pay.java
+++ b/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/wx/utils/WxV3Pay.java
@@ -5,6 +5,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ruoyi.payment.wx.model.WeixinProperties;
+import com.ruoyi.payment.wx.model.WxCloseOrderModel;
import com.ruoyi.payment.wx.model.WxPaymentInfoModel;
import com.ruoyi.payment.wx.model.WxPaymentRefundModel;
import com.ruoyi.payment.wx.resp.NotifyV3PayDecodeRespBody;
@@ -170,15 +171,14 @@
* 订单查询
*
* @param out_trade_no
- * @param mchid
* @return com.abl.biz.center.payment.wx.v3.NotifyV3PayDecodeRespBody
* @author xiaochen
* @date 2021-12-20 16:47
*/
@Override
- public NotifyV3PayDecodeRespBody query(String out_trade_no, String mchid) {
+ public NotifyV3PayDecodeRespBody query(String out_trade_no) {
String url =
- String.format("/v3/pay/transactions/out-trade-no/%s", out_trade_no) + String.format("?mchid=%s", mchid);
+ String.format("/v3/pay/transactions/out-trade-no/%s", out_trade_no) + String.format("?mchid=%s", this.getConfig().getMchId());
return query(this.httpClient, this.config.getHttpReadTimeoutMs(), this.config.getHttpConnectTimeoutMs(), url);
}
@@ -194,5 +194,18 @@
// refundModel.setNotify_url(this.config.getV3().getNotifyRefundUrl());
return refund(this.httpClient, "/v3/refund/domestic/refunds", this.config.getHttpReadTimeoutMs(), this.config.getHttpConnectTimeoutMs(), refundModel);
}
-
+
+
+ /**
+ * 关闭订单
+ * @param out_trade_no
+ * @return
+ */
+ @Override
+ public String close(String out_trade_no) {
+ String uri = String.format("/v3/pay/transactions/out-trade-no/%s/close", out_trade_no);
+ WxCloseOrderModel wxCloseOrderModel = new WxCloseOrderModel();
+ wxCloseOrderModel.setMchid(this.config.getMchId());
+ return close(this.httpClient, uri, this.config.getHttpReadTimeoutMs(), this.config.getHttpConnectTimeoutMs(), wxCloseOrderModel);
+ }
}
--
Gitblit v1.7.1