fix: 微信支付公钥改为可选

This commit is contained in:
邹景立 2025-03-04 14:11:20 +08:00
parent 6adf4c9120
commit ab40022482
2 changed files with 7 additions and 7 deletions

View File

@ -171,12 +171,12 @@ class Config extends Controller
if ($this->request->isPost()) {
$local = LocalStorage::instance();
$wechat = $this->request->post('wechat');
if (empty($wechat['mch_pay_sid'])) {
$this->error('微信支付公钥序号为空!');
}
if (empty($wechat['mch_ssl_pay']) || !$local->has($wechat['mch_ssl_pay'], true)) {
$this->error('微信支付公钥不能为空!');
}
// if (empty($wechat['mch_pay_sid'])) {
// $this->error('微信支付公钥序号为空!');
// }
// if (empty($wechat['mch_ssl_pay']) || !$local->has($wechat['mch_ssl_pay'], true)) {
// $this->error('微信支付公钥不能为空!');
// }
// PEM 证书模式处理
if ($wechat['mch_ssl_type'] === 'pem') {
if (empty($wechat['mch_ssl_key']) || !$local->has($wechat['mch_ssl_key'], true)) {

View File

@ -37,7 +37,7 @@
<label class="layui-form-item relative block">
<span class="help-label"><b>微信 V3 支付公钥ID</b>ssl_pay_unid</span>
<input name="wechat.mch_pay_sid" vali-name="微信商户V3支付公钥ID" placeholder="请输入微信商户V3支付公钥ID必填" maxlength="45" pattern="PUB_KEY_ID_.{34}" required value="{$data.mch_pay_sid|default=''}" class="layui-input">
<input name="wechat.mch_pay_sid" vali-name="微信商户V3支付公钥ID" placeholder="请输入微信商户V3支付公钥ID必填" maxlength="45" pattern="PUB_KEY_ID_.{34}" value="{$data.mch_pay_sid|default=''}" class="layui-input">
<span class="help-block">微信商户 V3 支付证书ID需要在微信商户平台操作设置操作密码并获取商户接口密钥</span>
</label>