wx.requestPayment(OBJECT)来调起微信支付收银台. 微信官方文档链接以 Promise 风格 调用:支持
小程序插件:不支持
微信 Windows 版:支持
微信 Mac 版:支持
| 参数名 | 是否必填 | 类型 | 说明 |
|---|---|---|---|
| timeStamp | 是 | string | 时间戳, 使用接口收款下单接口返回的metadata.wechatpay.timeStamp |
| nonceStr | 是 | string | 随机字符串, 使用接口收款下单接口返回的metadata.wechatpay.nonceStr |
| package | 是 | string | 额外信息, 使用接口收款下单接口返回的metadata.wechatpay.pkg |
| signType | 是 | string | 签名方法, 使用接口收款下单接口返回的metadata.wechatpay.signType |
| paySign | 是 | string | 签名, 使用接口收款下单接口返回的metadata.wechatpay.paySign |
| success | 否 | function | 接口调用成功的回调函数 |
| fail | 否 | function | 接口调用失败的回调函数 |
| complete | 否 | function | 接口调用结束的回调函数(调用成功、失败都会执行) |
| 回调类型 | errMsg | 描述 |
|---|---|---|
| success | requestPayment:ok | 调用支付成功 |
| fail | requestPayment:fail cancel | 用户支付取消 |
| fail | requestPayment:fail (detail message) | 调用支付失败,其中 detail message 为后台返回的详细失败原因 |