测试问题代码修改
This commit is contained in:
parent
2804ba4216
commit
4c8366cdae
@ -140,6 +140,7 @@ public class WeChatPayNotifyServiceImpl implements WeChatPayNotifyService {
|
|||||||
resultMap.put("message", "通知验签失败");
|
resultMap.put("message", "通知验签失败");
|
||||||
return JSON.toJSONString(resultMap);
|
return JSON.toJSONString(resultMap);
|
||||||
}
|
}
|
||||||
|
log.info(accountFlag + "微信通知的请求体信息 ===> {}", body);
|
||||||
String nonce = request.getHeader("Wechatpay-Nonce");
|
String nonce = request.getHeader("Wechatpay-Nonce");
|
||||||
String timestamp = request.getHeader("Wechatpay-Timestamp");
|
String timestamp = request.getHeader("Wechatpay-Timestamp");
|
||||||
String signature = request.getHeader("Wechatpay-Signature");
|
String signature = request.getHeader("Wechatpay-Signature");
|
||||||
@ -147,7 +148,12 @@ public class WeChatPayNotifyServiceImpl implements WeChatPayNotifyService {
|
|||||||
NotificationRequest notificationRequest = new NotificationRequest.Builder().withSerialNumber(serialNo)
|
NotificationRequest notificationRequest = new NotificationRequest.Builder().withSerialNumber(serialNo)
|
||||||
.withNonce(nonce).withTimestamp(timestamp).withSignature(signature).withBody(body).build();
|
.withNonce(nonce).withTimestamp(timestamp).withSignature(signature).withBody(body).build();
|
||||||
NotificationHandler handler = new NotificationHandler(xylVerifier, xylWeChatPaymentConfig.getXylPaymentKey().getBytes(StandardCharsets.UTF_8));
|
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)) {
|
if (Objects.isNull(notification)) {
|
||||||
log.error(accountFlag + "微信通知验签失败,请求体 ====> {}", body);
|
log.error(accountFlag + "微信通知验签失败,请求体 ====> {}", body);
|
||||||
response.setStatus(500);
|
response.setStatus(500);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user