diff --git a/plugin/think-plugs-wechat/src/controller/Config.php b/plugin/think-plugs-wechat/src/controller/Config.php index 71e8ee8d3..c452daba9 100644 --- a/plugin/think-plugs-wechat/src/controller/Config.php +++ b/plugin/think-plugs-wechat/src/controller/Config.php @@ -149,9 +149,11 @@ class Config extends Controller $this->mch_ssl_cer = sysconf('wechat.mch_ssl_cer'); $this->mch_ssl_key = sysconf('wechat.mch_ssl_key'); $this->mch_ssl_p12 = sysconf('wechat.mch_ssl_p12'); + $this->mch_ssl_pay = sysconf('wechat.mch_ssl_pay'); if (!$local->has($this->mch_ssl_cer, true)) $this->mch_ssl_cer = ''; if (!$local->has($this->mch_ssl_key, true)) $this->mch_ssl_key = ''; if (!$local->has($this->mch_ssl_p12, true)) $this->mch_ssl_p12 = ''; + if (!$local->has($this->mch_ssl_pay, true)) $this->mch_ssl_pay = ''; $this->fetch(); } else { $this->error('抱歉,数据提交地址错误!'); @@ -172,10 +174,13 @@ class Config extends Controller if ($wechat['mch_ssl_type'] === 'pem') { WechatService::withWxpayCert(['mch_id' => $wechat['mch_id']]); if (empty($wechat['mch_ssl_key']) || !$local->has($wechat['mch_ssl_key'], true)) { - $this->error('商户证书 KEY 不能为空!'); + $this->error('商户证书密钥不能为空!'); } if (empty($wechat['mch_ssl_cer']) || !$local->has($wechat['mch_ssl_cer'], true)) { - $this->error('商户证书 CERT 不能为空!'); + $this->error('商户证书公钥不能为空!'); + } + if (empty($wechat['mch_ssl_pay']) || !$local->has($wechat['mch_ssl_pay'], true)) { + $this->error('微信支付公钥不能为空!'); } } // P12 证书模式转 PEM 模式 @@ -200,6 +205,8 @@ class Config extends Controller 'mch_id' => $wechat['mch_id'], 'mch_key' => $wechat['mch_key'], 'mch_v3_key' => $wechat['mch_v3_key'], + 'ssl_pay_id' => $wechat['mch_v3_payid'] ?? '', + 'ssl_pay_text' => $local->get($wechat['ssl_cer_pay'], true), 'ssl_key_text' => $local->get($wechat['mch_ssl_key'], true), 'ssl_cer_text' => $local->get($wechat['mch_ssl_cer'], true), ]); diff --git a/plugin/think-plugs-wechat/src/view/config/payment.html b/plugin/think-plugs-wechat/src/view/config/payment.html index 516830fa6..0fabdcaa1 100644 --- a/plugin/think-plugs-wechat/src/view/config/payment.html +++ b/plugin/think-plugs-wechat/src/view/config/payment.html @@ -21,7 +21,7 @@ 微信商户账号,需要在微信商户平台获取,MCH_ID 与 APPID 匹配 - + 微信商户 V2 密钥MCH_KEY 微信商户 V2 密钥,需要在微信商户平台操作设置操作密码并获取商户接口密钥 @@ -33,6 +33,12 @@ 微信商户 V3 密钥,需要在微信商户平台操作设置操作密码并获取商户接口密钥 + + 微信商户 V3 支付证书IDMCH_V3_PAYCERT_ID + + 微信商户 V3 支付证书ID,需要在微信商户平台操作设置操作密码并获取商户接口密钥 + + @@ -48,24 +54,36 @@ - - 上传 P12 证书 + + 上传商户P12证书 + + + + + 上传微信支付公钥 - 上传 KEY 证书 + 上传商户证书密钥 + - - 上传 CERT 证书 + + 上传商户证书公钥 + + + + + 上传微信支付公钥 +