|
@@ -18,8 +18,13 @@ import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
|
|
|
import com.github.binarywang.wxpay.bean.notify.WxPayNotifyV3Response;
|
|
import com.github.binarywang.wxpay.bean.notify.WxPayNotifyV3Response;
|
|
|
import com.github.binarywang.wxpay.bean.notify.WxPayNotifyV3Result;
|
|
import com.github.binarywang.wxpay.bean.notify.WxPayNotifyV3Result;
|
|
|
import com.github.binarywang.wxpay.bean.notify.WxPayRefundNotifyV3Result;
|
|
import com.github.binarywang.wxpay.bean.notify.WxPayRefundNotifyV3Result;
|
|
|
|
|
+import com.github.binarywang.wxpay.bean.request.WxPayOrderQueryRequest;
|
|
|
|
|
+import com.github.binarywang.wxpay.bean.request.WxPayOrderQueryV3Request;
|
|
|
import com.github.binarywang.wxpay.bean.request.WxPayRefundV3Request;
|
|
import com.github.binarywang.wxpay.bean.request.WxPayRefundV3Request;
|
|
|
import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderV3Request;
|
|
import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderV3Request;
|
|
|
|
|
+import com.github.binarywang.wxpay.bean.result.BaseWxPayResult;
|
|
|
|
|
+import com.github.binarywang.wxpay.bean.result.WxPayOrderQueryResult;
|
|
|
|
|
+import com.github.binarywang.wxpay.bean.result.WxPayOrderQueryV3Result;
|
|
|
import com.github.binarywang.wxpay.bean.result.WxPayRefundV3Result;
|
|
import com.github.binarywang.wxpay.bean.result.WxPayRefundV3Result;
|
|
|
import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result.JsapiResult;
|
|
import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result.JsapiResult;
|
|
|
import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum;
|
|
import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum;
|
|
@@ -224,6 +229,7 @@ public class IWxPayService {
|
|
|
//调用充值记录服务,更新充值记录状态
|
|
//调用充值记录服务,更新充值记录状态
|
|
|
VipCardLog vipCardLog = new VipCardLog();
|
|
VipCardLog vipCardLog = new VipCardLog();
|
|
|
vipCardLog.setId(decryptRes.getOutTradeNo());
|
|
vipCardLog.setId(decryptRes.getOutTradeNo());
|
|
|
|
|
+ vipCardLog.setPaymentStatus("payment_status_have_paid");
|
|
|
vipCardLogService.updateVipCardLogByOrderId(vipCardLog);
|
|
vipCardLogService.updateVipCardLogByOrderId(vipCardLog);
|
|
|
// 成功返回200/204,body无需有内容
|
|
// 成功返回200/204,body无需有内容
|
|
|
log.info("订单处理完成,订单号: {}", decryptRes.getOutTradeNo());
|
|
log.info("订单处理完成,订单号: {}", decryptRes.getOutTradeNo());
|
|
@@ -231,7 +237,7 @@ public class IWxPayService {
|
|
|
} else {
|
|
} else {
|
|
|
log.warn("支付失败,订单号: {},状态: {}", decryptRes.getOutTradeNo(), decryptRes.getTradeState());
|
|
log.warn("支付失败,订单号: {},状态: {}", decryptRes.getOutTradeNo(), decryptRes.getTradeState());
|
|
|
// 失败返回4xx或5xx,且需要构造body信息
|
|
// 失败返回4xx或5xx,且需要构造body信息
|
|
|
- return AjaxResult.error();
|
|
|
|
|
|
|
+ return AjaxResult.error("订单支付失败");
|
|
|
}
|
|
}
|
|
|
} catch (WxPayException e) {
|
|
} catch (WxPayException e) {
|
|
|
log.error("处理微信支付回调失败", e);
|
|
log.error("处理微信支付回调失败", e);
|
|
@@ -445,7 +451,7 @@ public class IWxPayService {
|
|
|
* 定时任务调用此方法检查并处理超时订单
|
|
* 定时任务调用此方法检查并处理超时订单
|
|
|
*/
|
|
*/
|
|
|
public void processTimeoutOrders() {
|
|
public void processTimeoutOrders() {
|
|
|
- log.info("开始处理超时订单");
|
|
|
|
|
|
|
+// log.info("开始处理超时订单");
|
|
|
// 获取当前时间戳
|
|
// 获取当前时间戳
|
|
|
long currentTime = System.currentTimeMillis();
|
|
long currentTime = System.currentTimeMillis();
|
|
|
|
|
|
|
@@ -476,7 +482,7 @@ public class IWxPayService {
|
|
|
log.error("处理超时订单 {} 时发生错误", orderId, e);
|
|
log.error("处理超时订单 {} 时发生错误", orderId, e);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- log.info("超时订单处理完成");
|
|
|
|
|
|
|
+// log.info("超时订单处理完成");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|