9***@qq.com
9***@qq.com
  • 发布:2025-03-25 19:06
  • 更新:2025-09-28 11:18
  • 阅读:231

微信支付 使用requestPayment后返回 700000 其他支付错误, 这个可能的原因是什么

分类:uni-app x

其他支付错误感觉什么都没说,不知道到底是哪里的问题
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"
}

2025-03-25 19:06 负责人:无 分享
已邀请:
8***@qq.com

8***@qq.com

时间戳的问题吧,timestamp是数值型,文档写错了这个。

6***@tmp.dcloud.io

6***@tmp.dcloud.io

文档确实很坑,没说清楚,我调了很久才调试通:

  1. 参数名全部小写,必须要按照他文档里面的示例
  2. packageValue参数名统一改为package
    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),
......略.....

要回复问题请先登录注册