chore(addon/huaweipay): 商家公钥不作为异常处理

This commit is contained in:
2025-12-06 18:06:05 +08:00
parent f7413acd3e
commit f10b650a8f

View File

@@ -151,14 +151,14 @@ class HuaweiPayClient
throw new \Exception('商户应用公钥证书文件不存在: ' . $this->config['public_key']); throw new \Exception('商户应用公钥证书文件不存在: ' . $this->config['public_key']);
} }
$public_key_content = file_get_contents($public_key_path); $public_key_content = file_get_contents($public_key_path);
} else {
throw new \Exception('缺少必要配置public_key或public_key_text');
} }
if (!empty($public_key_content)) {
$this->public_key_certificate_instance = openssl_pkey_get_public($public_key_content); $this->public_key_certificate_instance = openssl_pkey_get_public($public_key_content);
if (!$this->public_key_certificate_instance) { if (!$this->public_key_certificate_instance) {
throw new \Exception('加载商户应用公钥证书失败,请检查证书格式是否正确'); throw new \Exception('加载商户应用公钥证书失败,请检查证书格式是否正确');
} }
}
// 加载华为平台支付证书 // 加载华为平台支付证书
$huawei_public_key_content = ''; $huawei_public_key_content = '';