|
@@ -23,7 +23,7 @@
|
|
|
<td>
|
|
|
<div class="row">
|
|
|
<div class="col-sm-8 col-xs-12">
|
|
|
- <input type="text" name="row[wechat][appid]" value="{$item.value.appid|default=''}" class="form-control" data-rule="" data-tip="APP应用中支付时使用"/>
|
|
|
+ <input type="text" name="row[wechat][appid]" value="{$item.value.appid|default=''}" class="form-control" data-rule="appid" data-tip="APP应用中支付时使用"/>
|
|
|
</div>
|
|
|
<div class="col-sm-4"></div>
|
|
|
</div>
|
|
@@ -34,7 +34,7 @@
|
|
|
<td>
|
|
|
<div class="row">
|
|
|
<div class="col-sm-8 col-xs-12">
|
|
|
- <input type="text" name="row[wechat][app_id]" value="{$item.value.app_id|default=''}" class="form-control" data-rule="" data-tip="公众号中支付时使用"/>
|
|
|
+ <input type="text" name="row[wechat][app_id]" value="{$item.value.app_id|default=''}" class="form-control" data-rule="appid" data-tip="公众号中支付时使用"/>
|
|
|
</div>
|
|
|
<div class="col-sm-4"></div>
|
|
|
</div>
|
|
@@ -45,7 +45,7 @@
|
|
|
<td>
|
|
|
<div class="row">
|
|
|
<div class="col-sm-8 col-xs-12">
|
|
|
- <input type="text" name="row[wechat][app_secret]" value="{$item.value.app_secret|default=''}" class="form-control" data-rule="" data-tip="公众号中支付时使用"/>
|
|
|
+ <input type="text" name="row[wechat][app_secret]" value="{$item.value.app_secret|default=''}" class="form-control" data-rule="keysecret" data-tip="公众号中支付时使用"/>
|
|
|
</div>
|
|
|
<div class="col-sm-4"></div>
|
|
|
</div>
|
|
@@ -56,7 +56,7 @@
|
|
|
<td>
|
|
|
<div class="row">
|
|
|
<div class="col-sm-8 col-xs-12">
|
|
|
- <input type="text" name="row[wechat][miniapp_id]" value="{$item.value.miniapp_id|default=''}" class="form-control" data-rule="" data-tip="仅在小程序支付时使用"/>
|
|
|
+ <input type="text" name="row[wechat][miniapp_id]" value="{$item.value.miniapp_id|default=''}" class="form-control" data-rule="appid" data-tip="仅在小程序支付时使用"/>
|
|
|
</div>
|
|
|
<div class="col-sm-4"></div>
|
|
|
</div>
|
|
@@ -67,29 +67,105 @@
|
|
|
<td>
|
|
|
<div class="row">
|
|
|
<div class="col-sm-8 col-xs-12">
|
|
|
- <input type="text" name="row[wechat][mch_id]" value="{$item.value.mch_id|default=''}" class="form-control" data-rule="" data-tip=""/>
|
|
|
+ <input type="number" name="row[wechat][mch_id]" value="{$item.value.mch_id|default=''}" class="form-control" data-rule="mchid" data-tip=""/>
|
|
|
</div>
|
|
|
<div class="col-sm-4"></div>
|
|
|
</div>
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
- <td>微信支付商户API密钥V2</td>
|
|
|
+ <td>商户APIv2密钥</td>
|
|
|
<td>
|
|
|
<div class="row">
|
|
|
<div class="col-sm-8 col-xs-12">
|
|
|
- <input type="text" name="row[wechat][key]" value="{$item.value.key|default=''}" class="form-control" data-rule="" data-tip=""/>
|
|
|
+ <input type="text" name="row[wechat][key]" value="{$item.value.key|default=''}" class="form-control" data-rule="keysecret" data-tip="仅用于微信支付V2接口"/>
|
|
|
</div>
|
|
|
<div class="col-sm-4"></div>
|
|
|
</div>
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
- <td>微信支付商户API密钥V3</td>
|
|
|
+ <td>V3配置</td>
|
|
|
+ <td>
|
|
|
+ <table class="table table-config mb-0">
|
|
|
+ <tbody>
|
|
|
+ <!-- V3 特有字段 -->
|
|
|
+ <tr>
|
|
|
+ <td>商户APIv3密钥</td>
|
|
|
+ <td>
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-sm-7 col-xs-12">
|
|
|
+ <input type="text" name="row[wechat][key_v3]" value="{$item.value.key_v3|default=''}" class="form-control" data-rule="keysecret" data-tip=""/>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-4"></div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>公钥ID</td>
|
|
|
+ <td>
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-sm-7 col-xs-12">
|
|
|
+ <input type="text" name="row[wechat][public_key_id]" value="{$item.value.public_key_id|default=''}" class="form-control" data-rule="public_key_id" data-tip=""/>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-4"></div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>公钥证书路径</td>
|
|
|
+ <td>
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-sm-7 col-xs-12">
|
|
|
+ <div class="input-group">
|
|
|
+ <input id="c-public_key" class="form-control" size="50" name="row[wechat][public_key]" type="text" value="{$item.value.public_key|htmlentities}" data-tip="可选, 仅在退款、红包等情况时需要用到">
|
|
|
+ <div class="input-group-addon no-border no-padding">
|
|
|
+ <span><button type="button" id="faupload-public_key" class="btn btn-danger faupload" data-url="epay/upload" data-multipart='{"certname":"public_key"}' data-mimetype="pem" data-input-id="c-public_key" data-multiple="false"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
|
|
+ </div>
|
|
|
+ <span class="msg-box n-right" for="c-public_key"></span>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top:5px;"><a href="https://pay.weixin.qq.com/doc/v3/partner/4012925323" target="_blank"><i class="fa fa-question-circle"></i> 如何获取微信支付公钥证书?</a></div>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-4"></div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <td>商户API证书cert</td>
|
|
|
+ <td>
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-sm-8 col-xs-12">
|
|
|
+ <div class="input-group">
|
|
|
+ <input id="c-cert_client" class="form-control" size="50" name="row[wechat][cert_client]" type="text" value="{$item.value.cert_client|htmlentities}" data-tip="可选, 仅在退款、红包等情况时需要用到">
|
|
|
+ <div class="input-group-addon no-border no-padding">
|
|
|
+ <span><button type="button" id="faupload-cert_client" class="btn btn-danger faupload" data-url="epay/upload" data-multipart='{"certname":"cert_client"}' data-mimetype="pem" data-input-id="c-cert_client" data-multiple="false"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
|
|
+ </div>
|
|
|
+ <span class="msg-box n-right" for="c-cert_client"></span>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top:5px;"><a href="https://kf.qq.com/faq/161222NneAJf161222U7fARv.html" target="_blank"><i class="fa fa-question-circle"></i> 如何获取微信支付商户API证书?</a></div>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-4"></div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>商户API证书key</td>
|
|
|
<td>
|
|
|
<div class="row">
|
|
|
<div class="col-sm-8 col-xs-12">
|
|
|
- <input type="text" name="row[wechat][key_v3]" value="{$item.value.key_v3|default=''}" class="form-control" data-rule="" data-tip=""/>
|
|
|
+ <div class="input-group">
|
|
|
+ <input id="c-cert_key" class="form-control" size="50" name="row[wechat][cert_key]" type="text" value="{$item.value.cert_key|htmlentities}" data-tip="可选, 仅在退款、红包等情况时需要用到">
|
|
|
+ <div class="input-group-addon no-border no-padding">
|
|
|
+ <span><button type="button" id="faupload-cert_key" class="btn btn-danger faupload" data-url="epay/upload" data-multipart='{"certname":"cert_key"}' data-mimetype="pem" data-input-id="c-cert_key" data-multiple="false"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
|
|
+ </div>
|
|
|
+ <span class="msg-box n-right" for="c-cert_key"></span>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top:5px;"><a href="https://kf.qq.com/faq/161222NneAJf161222U7fARv.html" target="_blank"><i class="fa fa-question-circle"></i> 如何获取微信支付商户API证书?</a></div>
|
|
|
</div>
|
|
|
<div class="col-sm-4"></div>
|
|
|
</div>
|
|
@@ -114,7 +190,7 @@
|
|
|
<td>
|
|
|
<div class="row">
|
|
|
<div class="col-sm-8 col-xs-12">
|
|
|
- <input type="text" name="row[wechat][sub_mch_id]" value="{$item.value.sub_mch_id|default=''}" class="form-control" data-rule="" data-tip="如果未用到子商户,请勿填写"/>
|
|
|
+ <input type="text" name="row[wechat][sub_mch_id]" value="{$item.value.sub_mch_id|default=''}" class="form-control" data-rule="mchid" data-tip="如果未用到子商户,请勿填写"/>
|
|
|
</div>
|
|
|
<div class="col-sm-4"></div>
|
|
|
</div>
|
|
@@ -125,7 +201,7 @@
|
|
|
<td>
|
|
|
<div class="row">
|
|
|
<div class="col-sm-8 col-xs-12">
|
|
|
- <input type="text" name="row[wechat][sub_appid]" value="{$item.value.sub_appid|default=''}" class="form-control" data-rule="" data-tip="如果未用到子商户,请勿填写"/>
|
|
|
+ <input type="text" name="row[wechat][sub_appid]" value="{$item.value.sub_appid|default=''}" class="form-control" data-rule="appid" data-tip="如果未用到子商户,请勿填写"/>
|
|
|
</div>
|
|
|
<div class="col-sm-4"></div>
|
|
|
</div>
|
|
@@ -136,7 +212,7 @@
|
|
|
<td>
|
|
|
<div class="row">
|
|
|
<div class="col-sm-8 col-xs-12">
|
|
|
- <input type="text" name="row[wechat][sub_app_id]" value="{$item.value.sub_app_id|default=''}" class="form-control" data-rule="" data-tip="如果未用到子商户,请勿填写"/>
|
|
|
+ <input type="text" name="row[wechat][sub_app_id]" value="{$item.value.sub_app_id|default=''}" class="form-control" data-rule="appid" data-tip="如果未用到子商户,请勿填写"/>
|
|
|
</div>
|
|
|
<div class="col-sm-4"></div>
|
|
|
</div>
|
|
@@ -147,7 +223,7 @@
|
|
|
<td>
|
|
|
<div class="row">
|
|
|
<div class="col-sm-8 col-xs-12">
|
|
|
- <input type="text" name="row[wechat][sub_miniapp_id]" value="{$item.value.sub_miniapp_id|default=''}" class="form-control" data-rule="" data-tip="如果未用到子商户,请勿填写"/>
|
|
|
+ <input type="text" name="row[wechat][sub_miniapp_id]" value="{$item.value.sub_miniapp_id|default=''}" class="form-control" data-rule="appid" data-tip="如果未用到子商户,请勿填写"/>
|
|
|
</div>
|
|
|
<div class="col-sm-4"></div>
|
|
|
</div>
|
|
@@ -164,42 +240,8 @@
|
|
|
</div>
|
|
|
</td>
|
|
|
</tr>
|
|
|
- <tr>
|
|
|
- <td>微信支付API证书cert</td>
|
|
|
- <td>
|
|
|
- <div class="row">
|
|
|
- <div class="col-sm-8 col-xs-12">
|
|
|
- <div class="input-group">
|
|
|
- <input id="c-cert_client" class="form-control" size="50" name="row[wechat][cert_client]" type="text" value="{$item.value.cert_client|htmlentities}" data-tip="可选, 仅在退款、红包等情况时需要用到">
|
|
|
- <div class="input-group-addon no-border no-padding">
|
|
|
- <span><button type="button" id="faupload-cert_client" class="btn btn-danger faupload" data-url="epay/upload" data-multipart='{"certname":"cert_client"}' data-mimetype="pem" data-input-id="c-cert_client" data-multiple="false"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
|
|
- </div>
|
|
|
- <span class="msg-box n-right" for="c-cert_client"></span>
|
|
|
- </div>
|
|
|
- <div style="margin-top:5px;"><a href="https://pay.weixin.qq.com" target="_blank"><i class="fa fa-question-circle"></i> 如何获取微信支付API证书?</a></div>
|
|
|
- </div>
|
|
|
- <div class="col-sm-4"></div>
|
|
|
- </div>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td>微信支付API证书key</td>
|
|
|
- <td>
|
|
|
- <div class="row">
|
|
|
- <div class="col-sm-8 col-xs-12">
|
|
|
- <div class="input-group">
|
|
|
- <input id="c-cert_key" class="form-control" size="50" name="row[wechat][cert_key]" type="text" value="{$item.value.cert_key|htmlentities}" data-tip="可选, 仅在退款、红包等情况时需要用到">
|
|
|
- <div class="input-group-addon no-border no-padding">
|
|
|
- <span><button type="button" id="faupload-cert_key" class="btn btn-danger faupload" data-url="epay/upload" data-multipart='{"certname":"cert_key"}' data-mimetype="pem" data-input-id="c-cert_key" data-multiple="false"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
|
|
- </div>
|
|
|
- <span class="msg-box n-right" for="c-cert_key"></span>
|
|
|
- </div>
|
|
|
- <div style="margin-top:5px;"><a href="https://pay.weixin.qq.com" target="_blank"><i class="fa fa-question-circle"></i> 如何获取微信支付API证书?</a></div>
|
|
|
- </div>
|
|
|
- <div class="col-sm-4"></div>
|
|
|
- </div>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
+
|
|
|
+
|
|
|
|
|
|
<tr>
|
|
|
<td>记录日志</td>
|
|
@@ -239,7 +281,7 @@
|
|
|
<td>
|
|
|
<div class="row">
|
|
|
<div class="col-sm-8 col-xs-12">
|
|
|
- <input type="text" name="row[alipay][pid]" value="{$item.value.pid|default=''}" class="form-control" data-rule="" data-tip=""/>
|
|
|
+ <input type="number" name="row[alipay][pid]" value="{$item.value.pid|default=''}" class="form-control" data-rule="pid" data-tip=""/>
|
|
|
</div>
|
|
|
<div class="col-sm-4"></div>
|
|
|
</div>
|
|
@@ -250,7 +292,7 @@
|
|
|
<td>
|
|
|
<div class="row">
|
|
|
<div class="col-sm-8 col-xs-12">
|
|
|
- <input type="text" name="row[alipay][app_id]" value="{$item.value.app_id|default=''}" class="form-control" data-rule="" data-tip=""/>
|
|
|
+ <input type="number" name="row[alipay][app_id]" value="{$item.value.app_id|default=''}" class="form-control" data-rule="pid" data-tip=""/>
|
|
|
</div>
|
|
|
<div class="col-sm-4"></div>
|
|
|
</div>
|
|
@@ -279,18 +321,6 @@
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
- <td>应用私钥(private_key)</td>
|
|
|
- <td>
|
|
|
- <div class="row">
|
|
|
- <div class="col-sm-8 col-xs-12">
|
|
|
- <input type="text" name="row[alipay][private_key]" value="{$item.value.private_key|default=''}" class="form-control" data-rule=""/>
|
|
|
- <div style="margin-top:5px;"><a href="https://opensupport.alipay.com/support/helpcenter/207/201602469554" target="_blank"><i class="fa fa-question-circle"></i> 如何获取应用私钥?</a></div>
|
|
|
- </div>
|
|
|
- <div class="col-sm-4"></div>
|
|
|
- </div>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
<td>签名方式</td>
|
|
|
<td>
|
|
|
<div>
|
|
@@ -320,7 +350,7 @@
|
|
|
<div class="row">
|
|
|
<div class="col-sm-8 col-xs-12">
|
|
|
<div class="input-group">
|
|
|
- <input id="c-ali_public_key" class="form-control" size="50" name="row[alipay][ali_public_key]" type="text" value="{$item.value.ali_public_key|default=''|htmlentities}" placeholder="普通公钥请直接粘贴,公钥证书请点击右侧的上传">
|
|
|
+ <input id="c-ali_public_key" class="form-control" size="50" name="row[alipay][ali_public_key]" type="text" value="{$item.value.ali_public_key|default=''|htmlentities}" placeholder="普通公钥请直接粘贴,公钥证书请点击上传">
|
|
|
<div class="input-group-addon no-border no-padding {if ($item.value.signtype??'')==='publickey' || ($item.value.signtype??'')==''}hidden{/if}" data-signtype="cert">
|
|
|
<span><button type="button" id="faupload-ali_public_key" class="btn btn-danger faupload" data-url="epay/upload" data-multipart='{"certname":"ali_public_key"}' data-mimetype="crt" data-input-id="c-ali_public_key" data-multiple="false"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
|
|
</div>
|
|
@@ -369,6 +399,25 @@
|
|
|
</div>
|
|
|
</td>
|
|
|
</tr>
|
|
|
+ <tr>
|
|
|
+ <td>应用私钥(private_key)</td>
|
|
|
+ <td>
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-sm-8 col-xs-12">
|
|
|
+ <input type="text" name="row[alipay][private_key]" value="{$item.value.private_key|default=''}" class="form-control" data-rule=""/>
|
|
|
+ <div style="margin-top:5px;">
|
|
|
+ <span data-signtype="publickey" class="{if ($item.value.signtype??'')==='cert'}hidden{/if}">
|
|
|
+ <a href="https://opensupport.alipay.com/support/FAQ/671860f40f6363044540b717prod" target="_blank"><i class="fa fa-question-circle"></i> 如何获取应用私钥?</a>
|
|
|
+ </span>
|
|
|
+ <span data-signtype="cert" class="{if ($item.value.signtype??'')==='publickey' || ($item.value.signtype??'')==''}hidden{/if}">
|
|
|
+ <a href="https://opensupport.alipay.com/support/FAQ/6718ab4563fae8044fe13dc7prod" target="_blank"><i class="fa fa-question-circle"></i> 如何获取应用私钥?</a>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-4"></div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
|
|
|
<tr>
|
|
|
<td>记录日志</td>
|
|
@@ -414,6 +463,36 @@
|
|
|
define('backend/addon', ['backend', 'form'], function (Backend, Form) {
|
|
|
var Controller = {
|
|
|
config: function () {
|
|
|
+ $.validator.config({
|
|
|
+ rules: {
|
|
|
+ appid: function (element) {
|
|
|
+ if (!element.value.toString().match(/^wx[a-zA-Z0-9]{16}$/)) {
|
|
|
+ return __('必须以wx开头,且长度为18位');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ keysecret: function (element) {
|
|
|
+ if (!element.value.toString().match(/^[a-zA-Z0-9]{32}$/)) {
|
|
|
+ return __('长度为32位,且为字母数字');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ public_key_id: function (element) {
|
|
|
+ if (!element.value.toString().match(/^PUB_KEY_ID_[0-9]{34}$/)) {
|
|
|
+ return __('必须以PUB_KEY_ID_开头,长度为45位');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mchid: function (element) {
|
|
|
+ if (!element.value.toString().match(/^[0-9]{8,32}$/)) {
|
|
|
+ return __('长度为至少8位,且为数字');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ pid: function (element) {
|
|
|
+ if (!element.value.toString().match(/^[0-9]{16}$/)) {
|
|
|
+ return __('长度为16位,且为数字');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
$(document).on("click", ".nav-group li a[data-toggle='tab']", function () {
|
|
|
if ($(this).attr("href") === "#all") {
|
|
|
$(".tab-pane").addClass("active in");
|