其他支付错误感觉什么都没说,不知道到底是哪里的问题
requestPayment参数用的:
provider:'wxpay',
orderInfo:JSON.stringify(param)
其中param是下面的数据:
appId:xxx,
partnerId:xxx,
nonceStr:xxx,
packageValue:'Sign=WXPay',
prepayId:xxx,
timeStamp:xxx,
sign:xxx
xxx都是后端返回的。
然后微信返回了下面的错误
{
"cause": null,
"data": null,
"errCode":
//[number]
700000,
"errMsg": "Other payment errors.",
"errSubject": "uni-requestPayment",
"message": "",
"name": "Error"
}
2 个回复
8***@qq.com
时间戳的问题吧,timestamp是数值型,文档写错了这个。
6***@tmp.dcloud.io
文档确实很坑,没说清楚,我调了很久才调试通:
3.timestamp是整型
我的示例代码:
// 微信支付参数处理
const wxPayParams = {
appid: appResult['appid'] as string,
partnerid: appResult['partnerId'] as string,
prepayid: appResult['prepayId'] as string,
package: appResult['packageValue'] as string,
noncestr: appResult['noncestr'] as string,
timestamp: parseInt(appResult['timestamp'] as string),
sign: appResult['sign'] as string
}
uni.requestPayment({
provider: 'wxpay',
orderInfo: JSON.stringify(wxPayParams),
......略.....