wechatpay-apiv3/wechatpay-php

demo 微信支付平台证书下载 提示 SIGN_ERROR

Closed this issue · 1 comments

运行环境

- OS:ubuntu
- PHP:7.4
- wechatpay-php:1.4

描述你的问题现象

{"success":false,"code":500,"message":"Client error: GET https:\/\/api.mch.weixin.qq.com\/v3\/certificates resulted in a 401 Unauthorized response:\n{"code":"SIGN_ERROR","message":" 签名信息错误,验签失败"}\n"}

image

php 框架是 hyperf 2.2

你好。

请参考下面的方式检查下私钥是否正确:

  1. 如何查看证书序列号? 检查商户证书 apiclient_cert.pem 的证书序列号是否是 1B8***
  2. 使用了错误的商户私钥 检查你的私钥和证书是否成对的,以确定你的私钥用对了。

另外,从你的代码中看,你使用了错误的微信支付平台证书,apiclient_cert.pem 是跟商户私钥配对的商户证书。不过,这不会导致请求的签名验证失败。