We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// 返回类型为 ResponseEntity.BodyBuilder 不正确 // return ResponseEntity.status(HttpStatus.OK); // 应改为返回类型 ResponseEntity return ResponseEntity.status(HttpStatus.OK).build();
微信支付通知接口使用README的回调通知代码即可复现 回调通知链接引用
不报错 No acceptable representation
// 构造 RequestParam RequestParam requestParam = new RequestParam.Builder() .serialNumber(wechatPaySerial) .nonce(wechatpayNonce) .signature(wechatSignature) .timestamp(wechatTimestamp) .body(requestBody) .build(); // 如果已经初始化了 RSAAutoCertificateConfig,可直接使用 // 没有的话,则构造一个 NotificationConfig config = new RSAAutoCertificateConfig.Builder() .merchantId(merchantId) .privateKeyFromPath(privateKeyPath) .merchantSerialNumber(merchantSerialNumber) .apiV3Key(apiV3Key) .build(); // 初始化 NotificationParser NotificationParser parser = new NotificationParser(config); try { // 以支付通知回调为例,验签、解密并转换成 Transaction Transaction transaction = parser.parse(requestParam, Transaction.class); } catch (ValidationException e) { // 签名验证失败,返回 401 UNAUTHORIZED 状态码 logger.error("sign verification failed", e); return ResponseEntity.status(HttpStatus.UNAUTHORIZED); } // 如果处理失败,应返回 4xx/5xx 的状态码,例如 500 INTERNAL_SERVER_ERROR if (/* process error */) { return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR); } // 处理成功,返回 200 OK 状态码 return ResponseEntity.status(HttpStatus.OK);
Windows11
Java 17
0.2.14
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
错误描述
重现bug的步骤
微信支付通知接口使用README的回调通知代码即可复现
回调通知链接引用
预期行为
不报错 No acceptable representation
导致错误的代码片段
操作系统
Windows11
Java 版本
Java 17
wechatpay-java 版本
0.2.14
其他信息
No response
The text was updated successfully, but these errors were encountered: