From 1095b6c192894d778de0b70b936795c5becf397a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Mon, 3 Mar 2025 19:19:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E8=AF=81=E4=B9=A6=E5=8F=8A=E6=94=AF=E4=BB=98=E8=AF=81=E4=B9=A6?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WePayV3/Contracts/BasicWePay.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/WePayV3/Contracts/BasicWePay.php b/WePayV3/Contracts/BasicWePay.php index 668d722..bcea5a8 100644 --- a/WePayV3/Contracts/BasicWePay.php +++ b/WePayV3/Contracts/BasicWePay.php @@ -57,9 +57,9 @@ abstract class BasicWePay 'mch_v3_key' => '', // 微信商户密钥,需要配置 'cert_serial' => '', // 商户证书序号,无需配置 'cert_public' => '', // 商户公钥内容,需要配置 - 'cert_private' => '', // 商户密钥内容,需要配置 - 'mp_cert_serial' => '', // 平台证书序号,无需配置 - 'mp_cert_content' => '', // 平台证书内容,无需配置 + 'cert_private' => '', // 商户密钥内容,需要配置Ï + 'mp_cert_serial' => '', // 平台证书序号,无需配置 ( 新平台,当做微信支付证书用 ) + 'mp_cert_content' => '', // 平台证书内容,无需配置 ( 新平台,当做微信支付证书Ï用 ) ]; /** @@ -118,8 +118,11 @@ abstract class BasicWePay } // 自动配置平台证书 - if ($this->autoCert) { - $this->_autoCert(); + if (empty($this->config['mp_cert_serial']) || empty($this->config['mp_cert_content'])) { + if ($this->autoCert) $this->_autoCert(); + } else { + $this->config['mp_cert_serial'] = $options['mp_cert_serial']; + $this->config['mp_cert_content'] = $options['mp_cert_content']; } // 服务商参数支持