3,159
社区成员
发帖
与我相关
我的任务
分享//调用微信JS api 支付
function jsApiCall()
{
WeixinJSBridge.invoke(
'getBrandWCPayRequest',
<?php echo $jsApiParameters; ?>, //此处是json数据
function(res){
//WeixinJSBridge.log(res.err_msg);
alert(res.err_msg + ",ok");
}
);
}
function callpay()
{
if (typeof WeixinJSBridge == "undefined"){
if( document.addEventListener ){
document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
}else if (document.attachEvent){
document.attachEvent('WeixinJSBridgeReady', jsApiCall);
document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
}
}else{
jsApiCall();
}
}
这是点击跳转后的链接地址:https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx74c084c4bf6edf63&redirect_uri=http%3a%2f%2fwxpay.tealg.com%2fexample%2fProductPage.aspx&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect
这是微信服务号的配置:


