签名没错,参数没错,最后发现是我上面的请求url写错了
$pay_url = "https://api.mch.weixin.qq.com/pay/unifiedorder/?";
我加了个/?
就报错了,把这两个去掉
$pay_url = "https://api.mch.weixin.qq.com/pay/unifiedorder";
就OK了
来源:CSDN
作者:坏事做尽丶mata川
链接:https://blog.csdn.net/qq_35510729/article/details/103979342