|
|
@@ -87,5 +87,39 @@ public class WechatPayController {
|
|
|
return WxPayNotifyResponse.success("成功");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc : 退款的回调
|
|
|
+ * @author : 姜永辉
|
|
|
+ * @date : 2024/03/06 11:20
|
|
|
+ */
|
|
|
+ @PostMapping("/refund/order/{appId}")
|
|
|
+ public String parseRefundNotifyResult(@PathVariable(value = "appId") String appId, @RequestBody String xmlData)
|
|
|
+ throws WxPayException {
|
|
|
+ log.info("parseOrderNotifyResult--0" + appId + "---" + xmlData);
|
|
|
+ WxPayService wxPayService = wechatPayService.getWxPayService();
|
|
|
+ final WxPayOrderNotifyResult notifyResult = wxPayService.parseOrderNotifyResult(xmlData);
|
|
|
+ // 另起线程处理业务
|
|
|
+ executorService.execute(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ String resultCode = notifyResult.getResultCode();
|
|
|
+ log.info("parseOrderNotifyResult--1" + resultCode );
|
|
|
+ // 支付成功
|
|
|
+ if (resultCode.equals("SUCCESS")) {
|
|
|
+ // 处理支付成功逻辑
|
|
|
+ try {
|
|
|
+ wechatPayService.notifyWechatPay(notifyResult);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("微信回调业务处理报错,params:" + notifyResult, e);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ log.error("没有处理微信回调业务,交易状态:{},params:{}", resultCode, JSONObject.toJSON(notifyResult));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ log.info("parseOrderNotifyResult--10000-成功" );
|
|
|
+ return WxPayNotifyResponse.success("成功");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|