3,157
社区成员




[JSSDK Info] chooseWXPay
input {"timeStamp":"1463795094480","nonceStr":"ODnLvJDB3nH88SiB","package":"prepay_id=wx2016052109450115030b132d0479775718","paySign":"E84A5C703E0400BB2AEA3FCEDEB39EAD","signType":"JSAPI"};
output {"errMsg":"没有此SDK或暂不支持此SDK模拟"}
wx.chooseWXPay({
appId: data.appId,
timestamp: data.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
nonceStr: data.nonceStr, // 支付签名随机串,不长于 32 位
package: data.packageValue, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=***)
signType: data.signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
paySign: data.paySign, // 支付签名
success: function (res) {
alert(res+"+");
if(res.errMsg == "chooseWXPay:ok" ) {
//支付成功
}else{
alert(res.errMsg);
}
},
cancel:function(res){
alert(res+"*");
//支付取消
},
error:function(res){
alert(res+"-");
}
});
wx.chooseWXPay({
appId: data.appId,
timestamp: data.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
nonceStr: data.nonceStr, // 支付签名随机串,不长于 32 位
package: data.packageValue, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=***)
signType: data.signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
paySign: data.paySign, // 支付签名
success: function (res) {
alert(res+"+");
if(res.errMsg == "chooseWXPay:ok" ) {
//支付成功
}else{
alert(res.errMsg);
}
},
cancel:function(res){
alert(res+"*");
//支付取消
},
error:function(res){
alert(res+"-");
}
});
WeixinJSBridge.invoke(
'getBrandWCPayRequest', {
"appId":data.appId, //公众号名称,由商户传入
"timeStamp":data.timeStamp, //时间戳,自1970年以来的秒数
"nonceStr": data.nonceStr, //随机串
"package": data.packageValue,
"signType":data.signType, //微信签名方式:
"paySign": data.paySign //微信签名
},
function(res){
alert(res.err_code + res.err_desc + res.err_msg);
if(res.err_msg == "get_brand_wcpay_request:ok" ) {alert(ok);} // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回 ok,但并不保证它绝对可靠。
}
);
这个也是一样的这个错wx.getBrandWCPayRequest is not a function
wx.getBrandWCPayRequest is not a function