微信支付秘钥报错contains the merchant's certificate serial number 生成秘钥apicli...
source link: https://yzsam.com/html/qOHkWm.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
使用环境 在linux 环境中使用 (没有服务器可以使用虚拟机 复制到本地) windows环境很麻烦
使用前准备 商户号、商户证书序列号、商户私匙文件(pem格式)、ApiV3密钥
安装好 微信支付SDK 使用composer安装
composer require wechatpay/wechatpay ApiV3 密钥设置 什么是APIv3密钥?如何设置?
第一步
进入对应项目目录根目录 校验composer 是否可用 输入命令 composer -v
第二步
查询当前可用命令 composer exec -l
第三步
查看命令是否可以执行 composer exec CertificateDownloader.php
最后执行命令
注意如果未设置 apiv3 密钥 则报错提示 这个错误 注意看看 证书路径是否正确
composer exec CertificateDownloader.php -- -m 你的商户号 -s 40字节你的商户证书序列号 -f 你的apiclient_key.pem文件路径(证书秘钥) -k 你的APIv3密钥 -o .(保存路径)
我的完整命令:
composer exec CertificateDownloader.php -- -m 1686528409 -s 482125928708A7206A4BB06482CD396E9E8425AF -f /www/wwwroot/chongdian-api/app/extend/cert/wechatpay/apiclient_key.pem -k LWez0fMGIuHTLWkdW01DrExR4HNfoyz4 -o /www/wwwroot/chongdian-api/app/extend/cert/wechatpay/
执行成功后
Serial Number 是证书序列号
Not Before 有效期开始时间
Not After 有效期结束时间
Saved to 保存路径
———————————————— 版权声明:本文为CSDN博主「fuchto」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/fuchto/article/details/122946465
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK