function onBridgeReady(){
WeixinJSBridge.invoke(
'getBrandWCPayRequest',{
"appId": "<%= @r['appid']%>",
"timeStamp": "<%= Time.now.to_i.to_s %>",
"nonceStr": "<%= @r['nonce_str']%>",
"package": "prepay_id=<%= @r['prepay_id']%>",
"signType": "MD5",
"paySign": "<%= @r['sign'] %>"
},
function(res){
alert(res.err_msg);
if(res.err_msg == "get_brand_wcpay_request:ok"){
alert('ok');
}else if(res.err_msg == "get_brand_wcpay_request:cancel") {
}else if(res.err_msg == "get_brand_wcpay_request:fail"){
alert('fail');
}else{
}
}
);
}
if (typeof WeixinJSBride == "undefined"){
if (document.addEventListener){
document.addEventListener('WeixinJSBridgeReady',onBridgeReady,false);
} else if (document.attachEvent){
document.attachEvent('WeixinJSBridgeReady',onBridgeReady);
document.attachEvent('onWeixinJSBridegReady',onBridgeReady);
}
}else{
onBridgeReady();
}
请问 fail 是什么原因?
get_brand_wcpay_request:fail 怎么解