来人救命啊
微信支付V3正常调起支付并支付成功,但是回调签名一直不过使用的是wechatpay-apache-httpclient 0.4.8 版本,一直提示的是签名验证失败[图片]
2023-04-27public WebResultDTO<String> wxPayNotify(String wechatpaySerial, String wechatpaySignature, String wechatpayTimestamp, String wechatpayNonce, String callback) { NotificationRequest request = new NotificationRequest.Builder().withSerialNumber(wechatpaySerial) .withNonce(wechatpayNonce) .withTimestamp(wechatpayTimestamp) .withSignature(wechatpaySignature) .withBody(callback) .build(); log.info("==wxPayNotify wechatpaySerial={} wechatpayNonce={} wechatpayTimestamp={} wechatpaySignature={} callback={} ",wechatpaySerial, wechatpayNonce, wechatpayTimestamp, wechatpaySignature, callback); NotificationHandler handler = new NotificationHandler(verifier, merchantSecret.getBytes(StandardCharsets.UTF_8)); try { // 验签和解析请求体 Notification notification = handler.parse(request); // 从notification中获取解密报文 log.info("===getDecryptData=={}",notification.getDecryptData()); }catch(Exception exc) { log.error(exc.getMessage(), exc); } return WebResultDTO.succ("ok"); } 验证失败提示 Signature length not correct: got 24 but was expecting 256
微信支付服务商支付成功回调验证签名报错?大部分支付回调都是正常的,有一两个回调报错 java.security.SignatureException: Signature length not correct: got 254 but was expecting 256 [图片]
2023-04-25