diff --git a/CHANGELOG.md b/CHANGELOG.md index d354fed..254dc60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v3.5.3-TBD + +### optimized + +- optimize: 支付宝公钥使用公共函数获取(#835) + ## v3.5.2 ### fixed diff --git a/src/Plugin/Alipay/PreparePlugin.php b/src/Plugin/Alipay/PreparePlugin.php index 37ce57f..4d0f445 100644 --- a/src/Plugin/Alipay/PreparePlugin.php +++ b/src/Plugin/Alipay/PreparePlugin.php @@ -16,6 +16,7 @@ use Yansongda\Pay\Pay; use Yansongda\Pay\Rocket; use function Yansongda\Pay\get_alipay_config; +use function Yansongda\Pay\get_public_cert; use function Yansongda\Pay\get_tenant; class PreparePlugin implements PluginInterface @@ -108,8 +109,7 @@ class PreparePlugin implements PluginInterface throw new InvalidConfigException(Exception::ALIPAY_CONFIG_ERROR, 'Missing Alipay Config -- [app_public_cert_path]'); } - $cert = file_get_contents($path); - $ssl = openssl_x509_parse($cert); + $ssl = openssl_x509_parse(get_public_cert($path)); if (false === $ssl) { throw new InvalidConfigException(Exception::ALIPAY_CONFIG_ERROR, 'Parse `app_public_cert_path` Error');