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);
支付成功返回requestpayment:ok是正常的。还需要返回什么其他数据?
如果是直连商户,服务端应该先调用JSAPI下单接口在微信支付服务后台生成预支付交易单,返回发起支付的必要参数prepay_id。同时服务端接口还需要返回调用wx.requestPayment的所有参数。