关于微信支付 js api 错误
<div class="wxapi_container">
<h3 id="menu-pay">微信支付接口</h3>
<span class="desc">发起一个微信支付请求</span>
<button class="btn btn_primary" id="chooseWXPay">chooseWXPay</button>
</div>
</div>
</body>
<script src="./js/jweixin-1.0.0.js"></script>
<script>
wx.config({
debug: true,
appId: 'wxc864d4ebc9f8b76c',
timestamp: 1435136888,
nonceStr: '8det8HQ8Q8DU9JZU',
signature: 'e8fa333e849db46f24fb409fcd862fb45d11666c',
jsApiList: [
'checkJsApi',
'playVoice',
'pauseVoice',
'stopVoice',
'uploadVoice',
'downloadVoice',
'chooseImage',
'previewImage',
'uploadImage',
'downloadImage',
'getNetworkType',
'openLocation',
'getLocation',
'hideOptionMenu',
'showOptionMenu',
'closeWindow',
'scanQRCode',
'chooseWXPay',
'openCard'
]
});
wx.ready(function () {
// 10 微信支付接口
// 10.1 发起一个支付请求
document.querySelector('#chooseWXPay').onclick = function () {
wx.chooseWXPay({
timestamp: 1435136888,
nonceStr: 'noncestr',
package: 'addition=action_id%3dgaby1234%26limit_pay%3d&bank_type=WX&body=innertest&fee_type=1&input_charset=GBK¬ify_url=http%3A%2F%2F120.204.206.246%2Fcgi-bin%2Fmmsupport-bin%2Fnotifypay&out_trade_no=1414723227818375338&partner=1900000109&spbill_create_ip=127.0.0.1&total_fee=1&sign=432B647FE95C7BF73BCD177CEECBEF8D',
signType: 'SHA1',
paySign: 'bd5b1933cda6e9548862944836a9b52e8c9a2b69'
});
};
});
wx.error(function (res) {
alert(res.errMsg);
});
</script>
按照官方的列子 做一个 微信支付的,
弹出 ErrorMsg choosewxpay:fail
有详细的前端微信支付的demo吗
直接前端做一个支付 是可以的吧
帕秋莉姆Q
9 years, 3 months ago