@@ -124,6 +124,8 @@ public class PayController {
@GetMapping("/weixin/callback/openidCode")
public void handleWeixinCallback(@RequestParam("code") String code, @RequestParam("state") String state, HttpSession session) {
+
+ System.out.println("回调来了啊 code="+code+"111111111111111111111111111111111111111111111state="+state);
if (!state.equals((String) session.getAttribute("WEIXIN_OAUTH_STATE"))) {
log.error("用户授权,state错误");
}
@@ -86,7 +86,8 @@ public class WxPayServiceMy {
public String getOpenIdCode(Long orderId) throws UnsupportedEncodingException {
- return String.format("https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=%s&state=%s#wechat_redirect",
+ String oAuth2Url = wxConfig.getOAuth2Url();
+ return String.format("https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=%s&state=%s#wechat_redirect",
wxConfig.getAppId(), URLEncoder.encode(wxConfig.getOAuth2Url(), "UTF-8"), "snsapi_base", orderId);
@@ -84,7 +84,7 @@ wxpay:
mchKey: tt9teerjiwer930i4t54u5894irhjehf
keyPath: /apiclient_cert.p12
apiV3Key: tt9teerjiwer930i4t54u5894irhjehf
- notifyUrl: http://529920wmvp80.vicp.fun:52722/admin/erp/pay/wxpay/notify
+ notifyUrl: https://api.raycos.net/index.html
subMchId: 1639506733
secret: 13803c1b0d911e023c7da0b300cbce89
- oAuth2Url: http://app.raycos.com.cn
+ oAuth2Url: https://api.raycos.net/index.html
@@ -83,7 +83,7 @@ wxpay:
- notifyUrl: https://apidoc.raycos.net/admin/erp/pay/wxpay/notify
+ notifyUrl: https://apidoc.raycos.net/weixin/callback/openidCode
subMchId: 1648546606
- oAuth2Url:
+ oAuth2Url: https://apidoc.raycos.net/weixin/callback/openidCode