下单后端只返回了订单号,调起支付其余参数有前端处理,安卓同样的方法可以支付,但是ios不可以,支付验真失败;
签名工具验证成功;
时间戳,随机数必须与下单相同吗???
request.partnerId = @ "1488**7822" ; request.prepayId= prepayId; request. package = @ "Sign=WXPay" ; request.nonceStr= [self randomStringWithLength: 32 ]; request.timeStamp= [self getNowTime]; NSString* stringA = [NSString stringWithFormat:@ "appid=%@&noncestr=%@&package=%@&partnerid=%@&prepayid=%@×tamp=%d&key=***************" , WXPatient_App_ID, request.nonceStr, request. package , request.partnerId, request.prepayId, (unsigned int )request.timeStamp]; request.sign= [self stringToMD5:stringA]; NSLog(@ "%@, sign=%@" , stringA,request.sign);
appid=wxc3500fb47****157&noncestr=tEnYIqCxFxmDRDt4XVjtsh2iXJX8yybg&package=Sign=WXPay&partnerid=1488**7822&prepayid=wx2216544109200*****abe351432201400×tamp=1569142481&key=c368c4d*******, sign=71ECBB450047F4C83184FB4F50C1D77D
PayReq request = new PayReq(); request.appId = APP_ID; request.partnerId = "1488**7822"; request.prepayId = prepayId; request.packageValue = "Sign=WXPay"; request.nonceStr = UUID.randomUUID().toString(); request.timeStamp = Long.toString(System.currentTimeMillis() / 1000); request.sign = sign(request.partnerId, request.prepayId,request.packageValue, request.nonceStr,equest.timeStamp, "c368c4d*********"); wxapi.sendReq(request); |
麻烦各位帮忙看一下,谢谢!!!!
签名问题和IOS或者android关系不大。只和参数,KEY以及参数编码有关。