- 微信支付回调参数解密时报错?
微信支付回调验签,使用的wechatpay-java 0.2.12,但是偶尔会出现报错:Caused by: com.wechat.pay.java.core.exception.ValidationException: Processing WechatPay notification,signature verification failed,signType[WECHATPAY2-SHA256-RSA2048] serial[659A3E7D0B61A6B2D97E9FEE05C68E4FC13A0B04] message[1729512147 6K9cI3QxLNdZ controller代码: @PostMapping("payCallback") public ResponseEntity<Void> payCallback( @RequestBody String body, @RequestHeader("Wechatpay-Serial") String wechatpaySerial, @RequestHeader("Wechatpay-Signature") String wechatpaySignature, @RequestHeader("Wechatpay-Timestamp") String wechatpayTimestamp, @RequestHeader("Wechatpay-Nonce") String wechatpayNonce ) { WechatVerificationIBO ibo = new WechatVerificationIBO(); ibo.setWechatSignature(wechatpaySignature); ibo.setWechatTimestamp(wechatpayTimestamp); ibo.setWechatpayNonce(wechatpayNonce); ibo.setWechatPaySerial(wechatpaySerial); ibo.setRequestBody(body); return wechatPayService.handlePayCallback(ibo); } 调用api部分代码: // 初始化 NotificationParser NotificationParser parser = new NotificationParser((NotificationConfig) config); // 构造 RequestParam RequestParam requestParam = new RequestParam.Builder() .serialNumber(wechatVerificationIBO.getWechatPaySerial()) .nonce(wechatVerificationIBO.getWechatpayNonce()) .signature(wechatVerificationIBO.getWechatSignature()) .timestamp(wechatVerificationIBO.getWechatTimestamp()) .body(wechatVerificationIBO.getRequestBody()) .build(); // 以支付通知回调为例,验签、解密并转换成 Transaction Transaction transaction = parser.parse(requestParam, Transaction.class); wechatVerificationOBO.setTransaction(transaction);
10-22 - 图片下载的java代码示例
我写了报错了,不知道哪里不对[图片]com.wechat.pay.java.core.exception.ServiceException: Wrong HttpStatusCode[400] httpResponseBody[] HttpRequest[{"http_method":"GET","url":"https://api.mch.weixin.qq.com/v3/merchant-service/images/ChsyMDAwMDAwMjAyNDEwMDgxODAyMTY1NjI0MTAYACCU9pi4BigBMAE4AQ%3D%3D","uri":"https://api.mch.weixin.qq.com/v3/merchant-service/images/ChsyMDAwMDAwMjAyNDEwMDgxODAyMTY1NjI0MTAYACCU9pi4BigBMAE4AQ%3D%3D",
10-09