Browse Source

修改支付失败异常的返回状态增加日志打印

wanxl 1 year ago
parent
commit
845e8560cd
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/main/java/com/template/controller/HouseOrderController.java

+ 3 - 1
src/main/java/com/template/controller/HouseOrderController.java

@@ -1863,6 +1863,7 @@ public class HouseOrderController implements HouseOrderAPI {
     public CommonResult pay(WxPayDto wpd, BindingResult bindingResult, HttpServletRequest request) throws Exception {
     public CommonResult pay(WxPayDto wpd, BindingResult bindingResult, HttpServletRequest request) throws Exception {
         System.out.println(TimeExchange.getTime() + "微信支付参数====:" + JSON.toJSON(wpd));
         System.out.println(TimeExchange.getTime() + "微信支付参数====:" + JSON.toJSON(wpd));
         String wxCode = request.getHeader("openId");
         String wxCode = request.getHeader("openId");
+        log.info("openId:"+wxCode);
         if (wxCode == null || wxCode == "") {
         if (wxCode == null || wxCode == "") {
             return CommonResult.fail("openId不能为空");
             return CommonResult.fail("openId不能为空");
         }
         }
@@ -2011,11 +2012,12 @@ public class HouseOrderController implements HouseOrderAPI {
 
 
         PrepayWithRequestPaymentResponse responseSdk = null;
         PrepayWithRequestPaymentResponse responseSdk = null;
         try {
         try {
+            log.info("请求支付参数:" + requestpay.toString());
             responseSdk = service.prepayWithRequestPayment(requestpay);
             responseSdk = service.prepayWithRequestPayment(requestpay);
             log.info("请求支付参数返回:" + responseSdk.toString());
             log.info("请求支付参数返回:" + responseSdk.toString());
         } catch (Exception e) {
         } catch (Exception e) {
             log.info("请求支付异常返回:" + e);
             log.info("请求支付异常返回:" + e);
-            return CommonResult.ok(e.getMessage());
+            return CommonResult.fail(e.getMessage());
         }
         }
         return CommonResult.ok(responseSdk);
         return CommonResult.ok(responseSdk);
     }
     }