|

楼主 |
发表于 2017-7-13 16:26:17
|
显示全部楼层
还有就是 用这个 var weixin = navigator.weixin;
weixin.getAccessToken(function(accessToken){
console.log('accessToken:' + accessToken);
weixin.generatePrepayId(
{"body":"x5",
"accessToken":accessToken,
"feeType":"1",
"notifyUrl":"http://www.justep.com",
"totalFee":"1",
"traceId":'123456',
"tradeNo":"123456789"},
function(prepayId){
console.log('prepayId:' + prepayId);
weixin.sendPayReq(prepayId,function(){
console.log('prepayId success');
alert("success");
},function(message){
alert("sendPayReq:"+ message);
});
},function(message){
alert("getPrepayId:" + message);
}
);
},function(message){
alert("getToken:" + message);
});
会报Uncaught TypeError: Cannot call method 'getAccessToken' of undefined |
|