微信app支付下单返回前端签名的细节

服务器端向微信下单成功后,再次生成签名返回前端时对应参数应该全部小写,小程序的是大写

app支付:

var str = "appid=" + payOrder.appid + "&noncestr=" + randomStr + "&package=Sign=WXPay&partnerid=" + payOrder.mch_id + "&prepayid="
+ payOrder.prepay_id + "&timestamp=" + payOrder.timeStamp + "&key=" + config[1];
var sign = CommonCode.Md5Encrypt(str);

小程序支付:

var str = "appId=" + payOrder.appid + "&nonceStr=" + randomStr + "&package=prepay_id=" + payOrder.prepay_id +
"&signType=" + signType + "&timeStamp=" + payOrder.timeStamp + "&key=" + config[1];

var sign = wxPayData.CalcMd5Sign(str);

 

posted @ 2023-02-10 13:19  YuanY  阅读(72)  评论(0编辑  收藏  举报