diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/wechatpaymentinfo/impl/WeChatPayNotifyServiceImpl.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/wechatpaymentinfo/impl/WeChatPayNotifyServiceImpl.java index c50932a..8c61dfd 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/wechatpaymentinfo/impl/WeChatPayNotifyServiceImpl.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/wechatpaymentinfo/impl/WeChatPayNotifyServiceImpl.java @@ -140,6 +140,7 @@ public class WeChatPayNotifyServiceImpl implements WeChatPayNotifyService { resultMap.put("message", "通知验签失败"); return JSON.toJSONString(resultMap); } + log.info(accountFlag + "微信通知的请求体信息 ===> {}", body); String nonce = request.getHeader("Wechatpay-Nonce"); String timestamp = request.getHeader("Wechatpay-Timestamp"); String signature = request.getHeader("Wechatpay-Signature"); @@ -147,7 +148,12 @@ public class WeChatPayNotifyServiceImpl implements WeChatPayNotifyService { NotificationRequest notificationRequest = new NotificationRequest.Builder().withSerialNumber(serialNo) .withNonce(nonce).withTimestamp(timestamp).withSignature(signature).withBody(body).build(); NotificationHandler handler = new NotificationHandler(xylVerifier, xylWeChatPaymentConfig.getXylPaymentKey().getBytes(StandardCharsets.UTF_8)); - Notification notification = handler.parse(notificationRequest); + Notification notification = null; + try { + notification = handler.parse(notificationRequest); + } catch (Exception e) { + log.warn("微信支付回调异常,异常信息为:{}", e.getMessage()); + } if (Objects.isNull(notification)) { log.error(accountFlag + "微信通知验签失败,请求体 ====> {}", body); response.setStatus(500);