场景:
公众号A是主体,公众号B、C、D等进行JSAPI 支付时,最终都是进入到A的商户号。
问题:
他们的openId都是不一样的,存在冲突问题
解决:
获得用户在公众号A下的openId
微信官方地址: https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=4_4
/**
* 微信授权获取code
* @param response
* @throws IOException
*/
@RequestMapping(value = "/getCode", produces = {"application/json;charset=UTF-8"}, method = RequestMethod.GET)
public void getCode(HttpServletResponse response) throws IOException {
response.sendRedirect(getCodeRequest());
}
public static String GetCodeRequest = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=