mirror of
https://gitee.com/yansongda/pay.git
synced 2024-11-29 18:58:38 +08:00
Fixed undefined array key wechat_public_cert_path
when don't set it. (#674)
* Fixed undefined array key `wechat_public_cert_path` when don't set it. * refactor: 优化 `wechat_public_cert_path` 配置 Co-authored-by: yansongda <me@yansongda.cn>
This commit is contained in:
parent
84682fcaee
commit
ebc939e1d7
10
CHANGELOG.md
10
CHANGELOG.md
@ -1,3 +1,13 @@
|
||||
## v3.2.1
|
||||
|
||||
### fixed
|
||||
|
||||
- fix: `wechat_public_cert_path` 未配置时报错的问题(#674)
|
||||
|
||||
### refactor
|
||||
|
||||
- refactor: 优化 `wechat_public_cert_path` 配置(#674)
|
||||
|
||||
## v3.2.0
|
||||
|
||||
### changed
|
||||
|
@ -221,11 +221,11 @@ if (!function_exists('reload_wechat_public_certs')) {
|
||||
}
|
||||
|
||||
$wechatConfig = get_wechat_config($params);
|
||||
$wechatConfig['wechat_public_cert_path'] = ((array) $wechatConfig['wechat_public_cert_path']) + ($certs ?? []);
|
||||
|
||||
Pay::set(ConfigInterface::class, Pay::get(ConfigInterface::class)->merge([
|
||||
'wechat' => [$params['_config'] ?? 'default' => $wechatConfig],
|
||||
]));
|
||||
Pay::get(ConfigInterface::class)->set(
|
||||
'wechat.'.get_tenant($params).'.wechat_public_cert_path',
|
||||
((array) ($wechatConfig['wechat_public_cert_path'] ?? [])) + ($certs ?? []),
|
||||
);
|
||||
|
||||
if (!is_null($serialNo) && empty($certs[$serialNo])) {
|
||||
throw new InvalidConfigException(Exception::WECHAT_CONFIG_ERROR, 'Get Wechat Public Cert Error');
|
||||
|
Loading…
Reference in New Issue
Block a user