Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_wechat_public_certs 提示 无可用的平台证书 #1046

Closed
puzzle9 opened this issue Dec 17, 2024 · 8 comments · Fixed by #1047
Closed

get_wechat_public_certs 提示 无可用的平台证书 #1046

puzzle9 opened this issue Dec 17, 2024 · 8 comments · Fixed by #1047

Comments

@puzzle9
Copy link

puzzle9 commented Dec 17, 2024

包版本号

v3.7.11

问题描述

image

你的代码

\Yansongda\Pay\Pay::config(config('pay'));
dd(\Yansongda\Pay\get_wechat_public_certs());

报错详情

微信返回状态码异常,请检查参数是否错误

sdk 日志

2024-12-17T21:23:56.316920+08:00 > yansongda.artful.INFO > [Artful] 请求第三方 API 成功 {"rocket":{"radar":{"url":"https://api.mch.weixin.qq.com/v3/certificates","method":"GET","headers":{"Host":["api.mch.weixin.qq.com"],"Accept":["application/json, text/plain, application/x-gzip"],"User-Agent":["yansongda/pay-v3"],"Content-Type":["application/json; charset=utf-8"],"Authorization":["WECHATPAY2-SHA256-RSA2048 mchid=\"1698246987\",nonce_str=\"SDkUJSAQuXAv9K9Au8uafUIacasPNems\",timestamp=\"1734441836\",serial_no=\"6FC7B5F782C4E4682F1131D06330D8A51E37011C\",signature=\"UpZtXYPlYX425JS1fzX32coM6wSuCj/fwmUlbw+ZRit2Pwqf0CLE9m7WmMSPJ6fY9W/kE9rd67feHy3CPo39PkCjysnBLL82PRI6+QNxyAnq4u7mfx5djzoweXEABbdFRixRVQCmmXNd+xamcIvXHK4ZeBCf0J3igCsad5Ua+As7d4k9Fg5gJvR1V4kDAGcV7Vg4LukxharQkjeRG3Tj7l4PVgx1nPVOAEbvCgKQ+r9/BqySuyahqe9VKZgSRB45fWLartroyeMAg76YARxLEBZTDxdB/9r/06oE0bWf9bOkWQpOLqFuwT1E+Vb9LyQ+jFpzSRZoS9Oxo2E1DNIOrg==\""]},"body":""},"params":{"out_trade_no":"20241217212355_PEzxcY","description":"subject-测试","amount":{"total":1,"currency":"CNY"},"payer":{"openid":"olKek7ciINLdo-smpgiPTTdu604s"}},"payload":{"_method":"GET","_url":"v3/certificates","_body":"","_authorization":"WECHATPAY2-SHA256-RSA2048 mchid=\"1698246987\",nonce_str=\"SDkUJSAQuXAv9K9Au8uafUIacasPNems\",timestamp=\"1734441836\",serial_no=\"6FC7B5F782C4E4682F1131D06330D8A51E37011C\",signature=\"UpZtXYPlYX425JS1fzX32coM6wSuCj/fwmUlbw+ZRit2Pwqf0CLE9m7WmMSPJ6fY9W/kE9rd67feHy3CPo39PkCjysnBLL82PRI6+QNxyAnq4u7mfx5djzoweXEABbdFRixRVQCmmXNd+xamcIvXHK4ZeBCf0J3igCsad5Ua+As7d4k9Fg5gJvR1V4kDAGcV7Vg4LukxharQkjeRG3Tj7l4PVgx1nPVOAEbvCgKQ+r9/BqySuyahqe9VKZgSRB45fWLartroyeMAg76YARxLEBZTDxdB/9r/06oE0bWf9bOkWQpOLqFuwT1E+Vb9LyQ+jFpzSRZoS9Oxo2E1DNIOrg==\""},"packer":"Yansongda\\Artful\\Contract\\PackerInterface","direction":"Yansongda\\Artful\\Contract\\DirectionInterface","destination":{"GuzzleHttp\\Psr7\\Response":[]},"destination_origin":{"status":404,"headers":{"Server":["nginx"],"Date":["Tue, 17 Dec 2024 13:24:14 GMT"],"Content-Type":["application/json; charset=utf-8"],"Content-Length":["238"],"Connection":["keep-alive"],"Keep-Alive":["timeout=8"],"Cache-Control":["no-cache, must-revalidate"],"X-Content-Type-Options":["nosniff"],"Request-ID":["08FEF685BB0610FF0218ABD1EDF50120BA3B28A9D905-269542984"],"Content-Language":["zh-CN"],"Wechatpay-Nonce":["ca4472aaacfce4b4266070707dd9b567"],"Wechatpay-Signature":["MN71Xp7eOnYMLh3qywrb05o2gWvCwTsuJ+PZF61LsvpiwYgbpEJpsotW/0WnzYq2QK6Oy32TTPX6Th/38RxwzLB6civUpSixqi7W5oMBG56TIaBIDIDCg6+qCtaPbfphFf7/vgTfOOodjWyjaYVN7/Upji9IQDty7iGHoh0U81RLUoOxOMxbNuqDn/lXbOsyQ0zSJC5kNWDUPmAEZ0Fl0yk8RAYyC4WbUQCgHOthHZS+aO6oibf2aQearvXWtkXR7N+TxlQW4StpaaiSc39haDYhhKjRnvKPMFGoHt7iHtHzjVS7YpI3/2s1Ej9i+eZfvt+G3q9aPdGY0vkgJa6Abw=="],"Wechatpay-Timestamp":["1734441854"],"Wechatpay-Serial":["PUB_KEY_ID_xxxx"],"Wechatpay-Signature-Type":["WECHATPAY2-SHA256-RSA2048"]},"body":"{\"code\":\"RESOURCE_NOT_EXISTS\",\"message\":\"无可用的平台证书,请在商户平台-API安全申请使用微信支付公钥。可查看指引https://pay.weixin.qq.com/docs/merchant/products/platform-certificate/wxp-pub-key-guide.html\"}"}}} 

nginx/apache 日志

php artisan serve 运行

其他

image
image

@yansongda
Copy link
Owner

微信支付最近做了更新,所以导致在未填写 wechat_public_cert_path 时会有些问题,可以先手动填写此参数临时解决,内容为微信支付公钥

https://pay.weixin.qq.com/doc/v3/merchant/4012154180

@yansongda
Copy link
Owner

方便的话,可以帮忙提个 PR

@yansongda yansongda pinned this issue Dec 17, 2024
@puzzle9
Copy link
Author

puzzle9 commented Dec 17, 2024

方便的话,可以帮忙提个 PR

研究了下 目前还达不到提交pr这个能力
不过没想到困扰我半天的 竟然是更新的这个原因

@ken678
Copy link
Contributor

ken678 commented Dec 18, 2024

以前都是系统自动获取公钥的,现在不行了?
1734499312478

1 similar comment
@ken678

This comment was marked as duplicate.

@yansongda
Copy link
Owner

老商户 没问题,依然可以自动获取,这里是新商户有问题,可以看看微信的公告

@yansongda
Copy link
Owner

文档已补充说明

@ken678
Copy link
Contributor

ken678 commented Dec 18, 2024

感觉这个调整还行 本身就应该填写平台证书,现在平台证书从以前接口获取方式变成后台下载 也更方便,以前我还吐槽官方sdk,怎么下载个平台证书还非得用命令行https://github.com/wechatpay-apiv3/wechatpay-php/blob/main/bin/README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants