收藏
回答

为什么wx.requestPayment回调参数错误?

 wx.requestPayment走通,走了success,里面的js执行了,但是返回的res只有{errmsg: "requestpayment:ok"},且没有其他参数。

         setTimeout(function() {

                         let that = _this

                          wx.requestPayment({

                              // provider: 'wxpay',

                              timeStamp: _this.timeStamp,

                              nonceStr: _this.nonceStr,

                              package:  'prepay_id='+_this.prepay_id,

                              signType: 'MD5',

                              paySign:  _this.paysign,

                //               success: function(res) {

                

                //                       console.log('success:' + JSON.stringify(res));

                //                     console.log('成功');

                //                     that.modalName = 'Modal2'

                //                     that.PageCur = 'choose'

                //                     that.clear()

                //               },

                //               fail: function(err) {

                //                 that.PageCur = 'choose'

                //                 that.modalName = 'Modal2'

                                

                //               },

                            complete:function(res){

                                console.log(res)

                            }

                          });

                     }, 600);

回答关注问题邀请回答
收藏

1 个回答

  • 浮生凉筑
    浮生凉筑
    2021-10-26

    支付成功返回requestpayment:ok是正常的。还需要返回什么其他数据?

    2021-10-26
    有用 1
    回复 2
    • 野生咸鱼
      野生咸鱼
      发表于移动端
      2021-10-26
      大佬,我们后端说要订单码,这个是哪里拿到的?
      2021-10-26
      回复
    • 浮生凉筑
      浮生凉筑
      2021-10-26回复野生咸鱼
      没有听说过‘订单码’,订单码是什么?
      如果是直连商户,服务端应该先调用JSAPI下单接口在微信支付服务后台生成预支付交易单,返回发起支付的必要参数prepay_id。同时服务端接口还需要返回调用wx.requestPayment的所有参数。
      2021-10-26
      1
      回复
登录 后发表内容