diff --git a/open-api/src/main/java/com/api/controller/v1/NotifyController.java b/open-api/src/main/java/com/api/controller/v1/NotifyController.java index 6dd5f24..fb075f6 100644 --- a/open-api/src/main/java/com/api/controller/v1/NotifyController.java +++ b/open-api/src/main/java/com/api/controller/v1/NotifyController.java @@ -49,7 +49,7 @@ public class NotifyController { public void lakala(@RequestBody String reqBody, HttpServletResponse response) { try { log.info("========= Start 拉卡拉交易通知 Start ==========="); - log.info("平台接收拉卡拉交易通知:", reqBody); + log.info("平台接收拉卡拉交易通知:" + reqBody); System.out.println(reqBody); JSONObject body = JSONObject.parseObject(reqBody); @@ -88,14 +88,18 @@ public class NotifyController { responseQueryTradeModel.setAttach(tradeOrder.getAttach()); responseQueryTradeModel.setSign(SignatureUtil.createSign(responseQueryTradeModel, merKeyService.getKeyByMerNo(tradeOrder.getMerNo()))); - log.info("发送URL:", order.getPayNotifyUrl()); - log.info("发送参数:", JSONObject.toJSONString(responseQueryTradeModel)); + log.info("发送URL:" + order.getPayNotifyUrl()); + log.info("发送参数:" + JSONObject.toJSONString(responseQueryTradeModel)); JSONObject result = HttpsUtils.doPost(order.getPayNotifyUrl(), JSONObject.toJSONString(responseQueryTradeModel)); - log.info("响应参数:", result); - BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream()); - out.write(result.toJSONString().getBytes()); - out.flush(); - out.close(); + if (result != null) { + log.info("响应参数:" + result); + BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream()); + out.write(result.toJSONString().getBytes()); + out.flush(); + out.close(); + } else { + log.info("响应参数:null"); + } } } catch (Exception e) {