使用证书接入支付宝的配置参考
配置参考项目的README.md:github.com/yansongda/pay
先把三个证书下载好。
应用公钥证书=>appCertPublicKey(或者会带上appid).crt
支付宝公钥证书=>alipayCertPublicKey_RSA2.crt
支付宝根证书=>alipayRootCert.crt
我把证书放在app\cert目录下,在正式环境可能要放在其它目录
'alipay' => [
'app_id' => '', //你自己的appid
'notify_url' => 'http://localhost/alipay/notify.php', //服务器回调地址
'return_url' => 'http://localhost/alipay/return.php', //前端回调地址
'ali_public_key' => app_path('cert/alipayCertPublicKey_RSA2.crt'),
'app_cert_public_key' => app_path('cert/appCertPublicKey.crt'), //可能要加上appid
'alipay_root_cert' => app_path('cert/alipayRootCert.crt'),
'private_key' => '', //支付宝开放平台生成的私钥
'log' => [
'file' => storage_path('logs/alipay.log'), //记录日志的目录
'level' => 'debug',
'type' => 'single',
'max_file' => 30,
],
'http' => [
'timeout' => 5.0,
'connect_timeout' => 5.0,
],
'mode' => 'dev', // optional,设置此参数,将进入沙箱模式
],
推荐文章: