mirror of
https://gitee.com/yansongda/pay.git
synced 2024-11-29 18:58:38 +08:00
optimize: 支付宝公钥使用公共函数获取 (#835)
* Use the get_public_cert function in Alipay to obtain the content of the public key. * update --------- Co-authored-by: yansongda <me@yansongda.cn>
This commit is contained in:
parent
85143decc3
commit
d3a85f954d
@ -1,3 +1,9 @@
|
||||
## v3.5.3-TBD
|
||||
|
||||
### optimized
|
||||
|
||||
- optimize: 支付宝公钥使用公共函数获取(#835)
|
||||
|
||||
## v3.5.2
|
||||
|
||||
### fixed
|
||||
|
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user