改进 私钥文件

This commit is contained in:
iVampireSP.com 2022-12-11 20:36:25 +08:00
parent 93a017702e
commit c89cd67d0a
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
2 changed files with 9 additions and 2 deletions

2
.gitignore vendored
View File

@ -20,4 +20,4 @@ rr
.rr.yaml
.DS_Store
/config/secrets
config/secrets
config/secrets/*

View File

@ -4,13 +4,20 @@
use Yansongda\Pay\Pay;
$secret_file = env('ALIPAY_APP_SECERT_CERT_PATH', config_path('secrets/alipayAppPriv.key'));
if (!file_exists($secret_file)) {
$secret_file = '';
} else {
$secret_file = file_get_contents($secret_file);
}
return [
'alipay' => [
'default' => [
// 必填-支付宝分配的 app_id
'app_id' => env('ALIPAY_APP_ID'),
// 必填-应用私钥 字符串或路径
'app_secret_cert' => trim(file_get_contents(config_path('secrets/alipayAppPriv.key'))),
'app_secret_cert' => $secret_file,
// 必填-应用公钥证书 路径
'app_public_cert_path' => config_path('secrets/appCertPublicKey.crt'),
// 必填-支付宝公钥证书 路径