forked from chanjarster/weixin-java-tools
-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
0_微信支付开发文档
Binary Wang edited this page Jan 30, 2024
·
2 revisions
- 微信支付官方文档入口
- 微信支付Demo项目
- 微信支付使用说明
- 企业付款相关接口的
Javadoc
- 分账相关接口的
Javadoc
- 其他已实现的微信支付接口的
Javadoc
- 微信支付接口请求参数正确情况下,如果一直报签名不对,请尝试修改下商户API密钥。
- 微信支付退款或发红包请求时报 “DerInputStream.getLength(): lengthTag=111, too big.”,请参考此文,或者此文
String encType = request.getParameter("encrypt_type");
String nonce = request.getParameter("nonce");
String timestamp = request.getParameter("timestamp");
String msgSignature = request.getParameter("msg_signature");
String signature = request.getParameter("signature");
String openid = request.getParameter("openid");
log.info("接收微信请求:[openid=[{}], [openid=[{}],[signature=[{}], encType=[{}], msgSignature=[{}],"
+ " timestamp=[{}], nonce=[{}], requestBody=[{}] ",
appid, openid, signature, encType, msgSignature, timestamp, nonce, requestBody);
// 请求里面没有对应信息。 // if (!this.wxMpService.switchover(appid)) { //appid // throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", appid)); // }
if (!wxMpService.checkSignature(timestamp, nonce, signature)) {
throw new IllegalArgumentException("非法请求,可能属于伪造的请求!");
}
return ResponseEntity.ok("");