关于微信公众号的开发

关于微信公众号的开发_第1张图片

url自定义,令牌token自定义

公众号支付,设置支付目录,设置回调在支付权限中

/*

* 进行接口验证

*/

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就可以了

你可能感兴趣的:(关于微信公众号的开发)