url自定義册舞,令牌token自定義
公眾號(hào)支付竭鞍,設(shè)置支付目錄编振,設(shè)置回調(diào)在支付權(quán)限中
/*
* 進(jìn)行接口驗(yàn)證
*/
String signature = request.getParameter("signature");
String timestamp = request.getParameter("timestamp");
String nonce = request.getParameter("nonce");
String echostr = request.getParameter("echostr");
System.out.println(signature);
System.out.println(timestamp);
System.out.println(nonce);
System.out.println(echostr);
if (null != timestamp && null != nonce && null != echostr && null != signature) {
if (WeiXinTools.access(TOKEN, signature, timestamp, nonce)) {
GotoWeiXinConnect gotoWeixinConnect = new GotoWeiXinConnect();
gotoWeixinConnect.setCreateTime(TimeUtil.getCurrentTimeDate());
gotoWeixinConnect.setModifyTime(TimeUtil.getCurrentTimeDate());
gotoWeixinConnect.setSignature(signature);
gotoWeixinConnect.setTimestamp(timestamp);
gotoWeixinConnect.setNonce(nonce);
gotoWeixinConnect.setEchostr(echostr);
gotoWeixinConnect.setGuid(MD5.getGuid());
gotoWeiXinConnectService.insertSelective(gotoWeixinConnect);
response.getWriter().write(echostr);
return;
}
return;
} else {
return;
}
只要返回echostr就可以了