|
- function config() {
- var wxPay = api.require('wxPay');
- wxPay.config({
- apiKey : '',
- mchId : '11',
- partnerKey : '11',
- notifyUrl : 'http://**.**'
- }, function(ret, err) {
- alert(JSON.stringify(ret));
- if (ret.status) {
- alert('配置商户支付参数成功');
- //成功
- wxPay.pay({
- description : 'iPad mini 16G 白色',
- totalFee : '1',
- tradeNo : '12177525012',
- }, function(ret, err) {
- alert(JSON.stringify(ret));
- if (ret.status) {
- alert(ret.result);
- } else {
- alert(JSON.stringify(err));
- // appid不存在
- }
- });
- } else {
- alert(err.code);
- }
- });
- };
复制代码
我wxPay.config参数可以不在xml中写
但是执行 wxPay.pay 里,就会提示 [appid不存在 ] 的错误
我猜想应该是 读xml 中 wxPay_appId 没读到 |
|