426 lines
26 KiB
PHP
Executable File
426 lines
26 KiB
PHP
Executable File
<?php
|
|
/* Smarty version 5.3.1, created on 2025-02-04 13:46:52
|
|
from 'file:admin/setting/billing.tpl' */
|
|
|
|
/* @var \Smarty\Template $_smarty_tpl */
|
|
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
|
'version' => '5.3.1',
|
|
'unifunc' => 'content_67a1a9cc2a4bc3_98629329',
|
|
'has_nocache_code' => false,
|
|
'file_dependency' =>
|
|
array (
|
|
'b1d3b6820e3effc3c235f696f66e41a5df87e572' =>
|
|
array (
|
|
0 => 'admin/setting/billing.tpl',
|
|
1 => 1712762115,
|
|
2 => 'file',
|
|
),
|
|
),
|
|
'includes' =>
|
|
array (
|
|
'file:admin/header.tpl' => 1,
|
|
'file:admin/footer.tpl' => 1,
|
|
),
|
|
))) {
|
|
function content_67a1a9cc2a4bc3_98629329 (\Smarty\Template $_smarty_tpl) {
|
|
$_smarty_current_dir = '/www/wwwroot/fuuu.cloud/resources/views/tabler/admin/setting';
|
|
$_smarty_tpl->renderSubTemplate('file:admin/header.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
|
|
?>
|
|
|
|
<div class="page-wrapper">
|
|
<div class="container-xl">
|
|
<div class="page-header d-print-none text-white">
|
|
<div class="row align-items-center">
|
|
<div class="col">
|
|
<h2 class="page-title">
|
|
<span class="home-title">财务设置</span>
|
|
</h2>
|
|
<div class="page-pretitle my-3">
|
|
<span class="home-subtitle">设置站点的财务系统</span>
|
|
</div>
|
|
</div>
|
|
<div class="col-auto ms-auto d-print-none">
|
|
<div class="btn-list">
|
|
<a id="save-setting" href="#" class="btn btn-primary">
|
|
<i class="icon ti ti-device-floppy"></i>
|
|
保存
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="page-body">
|
|
<div class="container-xl">
|
|
<div class="row row-deck row-cards">
|
|
<div class="col-md-12">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<ul class="nav nav-tabs card-header-tabs" data-bs-toggle="tabs">
|
|
<li class="nav-item">
|
|
<a href="#gateway" class="nav-link active" data-bs-toggle="tab">网关选择</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a href="#f2f" class="nav-link" data-bs-toggle="tab">支付宝当面付</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a href="#stripe" class="nav-link" data-bs-toggle="tab">Stripe</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a href="#epay" class="nav-link" data-bs-toggle="tab">EPay</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a href="#paypal" class="nav-link" data-bs-toggle="tab">PayPal</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="tab-content">
|
|
<div class="tab-pane active show" id="gateway">
|
|
<?php
|
|
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('payment_gateways'), 'value', false, 'key');
|
|
$foreach0DoElse = true;
|
|
foreach ($_from ?? [] as $_smarty_tpl->getVariable('key')->value => $_smarty_tpl->getVariable('value')->value) {
|
|
$foreach0DoElse = false;
|
|
?>
|
|
<div class="form-group mb-3 row">
|
|
<div class="row align-items-center">
|
|
<label class="form-label col-3 col-form-label"><?php echo $_smarty_tpl->getValue('key');?>
|
|
</label>
|
|
<label class="col-auto ms-auto form-check form-check-single form-switch">
|
|
<input id="<?php echo $_smarty_tpl->getValue('value');?>
|
|
_enable" class="form-check-input" type="checkbox"
|
|
<?php if ($_smarty_tpl->getSmarty()->getModifierCallback('in_array')($_smarty_tpl->getValue('value'),$_smarty_tpl->getValue('active_payment_gateway'))) {?>checked="" <?php }?>>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
}
|
|
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
|
</div>
|
|
<div class="tab-pane" id="f2f">
|
|
<div class="card-body">
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">App ID</label>
|
|
<div class="col">
|
|
<input id="f2f_pay_app_id" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['f2f_pay_app_id'];?>
|
|
">
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">PID</label>
|
|
<div class="col">
|
|
<input id="f2f_pay_pid" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['f2f_pay_pid'];?>
|
|
">
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">支付宝公钥</label>
|
|
<div class="col">
|
|
<input id="f2f_pay_public_key" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['f2f_pay_public_key'];?>
|
|
">
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">应用私钥</label>
|
|
<div class="col">
|
|
<input id="f2f_pay_private_key" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['f2f_pay_private_key'];?>
|
|
">
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">自定义回调地址(可选)</label>
|
|
<div class="col">
|
|
<input id="f2f_pay_notify_url" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['f2f_pay_notify_url'];?>
|
|
">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="tab-pane" id="stripe">
|
|
<div class="card-body">
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">API Key</label>
|
|
<div class="col">
|
|
<input id="stripe_api_key" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['stripe_api_key'];?>
|
|
">
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">Endpoint Secret</label>
|
|
<div class="col">
|
|
<input id="stripe_endpoint_secret" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['stripe_endpoint_secret'];?>
|
|
">
|
|
</div>
|
|
<div class="col-auto">
|
|
<button class="btn btn-primary"
|
|
hx-post="/admin/setting/billing/set_stripe_webhook" hx-swap="none"
|
|
hx-vals='js:{
|
|
stripe_api_key: document.getElementById("stripe_api_key").value
|
|
}'>
|
|
Set Webhook
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">网关货币</label>
|
|
<div class="col">
|
|
<input id="stripe_currency" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['stripe_currency'];?>
|
|
">
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">银行卡支付</label>
|
|
<div class="col">
|
|
<select id="stripe_card" class="col form-select"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['stripe_card'];?>
|
|
">
|
|
<option value="0">停用</option>
|
|
<option value="1" <?php if ($_smarty_tpl->getValue('settings')['stripe_card']) {?>selected<?php }?>>启用
|
|
</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">支付宝支付</label>
|
|
<div class="col">
|
|
<select id="stripe_alipay" class="col form-select"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['stripe_alipay'];?>
|
|
">
|
|
<option value="0">停用</option>
|
|
<option value="1" <?php if ($_smarty_tpl->getValue('settings')['stripe_alipay']) {?>selected<?php }?>>
|
|
启用
|
|
</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">微信支付</label>
|
|
<div class="col">
|
|
<select id="stripe_wechat" class="col form-select"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['stripe_wechat'];?>
|
|
">
|
|
<option value="0">停用</option>
|
|
<option value="1" <?php if ($_smarty_tpl->getValue('settings')['stripe_wechat']) {?>selected<?php }?>>
|
|
启用
|
|
</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">最低充值限额(整数)</label>
|
|
<div class="col">
|
|
<input id="stripe_min_recharge" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['stripe_min_recharge'];?>
|
|
">
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">最高充值限额(整数)</label>
|
|
<div class="col">
|
|
<input id="stripe_max_recharge" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['stripe_max_recharge'];?>
|
|
">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="tab-pane" id="epay">
|
|
<div class="card-body">
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">网关地址</label>
|
|
<div class="col">
|
|
<input id="epay_url" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['epay_url'];?>
|
|
">
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">商户ID</label>
|
|
<div class="col">
|
|
<input id="epay_pid" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['epay_pid'];?>
|
|
">
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">商户Key</label>
|
|
<div class="col">
|
|
<input id="epay_key" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['epay_key'];?>
|
|
">
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">签名方式</label>
|
|
<div class="col">
|
|
<input id="epay_sign_type" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['epay_sign_type'];?>
|
|
">
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">支付宝</label>
|
|
<div class="col">
|
|
<select id="epay_alipay" class="col form-select"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['epay_alipay'];?>
|
|
">
|
|
<option value="0">停用</option>
|
|
<option value="1" <?php if ($_smarty_tpl->getValue('settings')['epay_alipay']) {?>selected<?php }?>>启用
|
|
</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">微信支付</label>
|
|
<div class="col">
|
|
<select id="epay_wechat" class="col form-select"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['epay_wechat'];?>
|
|
">
|
|
<option value="0">停用</option>
|
|
<option value="1" <?php if ($_smarty_tpl->getValue('settings')['epay_wechat']) {?>selected<?php }?>>启用
|
|
</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">QQ钱包</label>
|
|
<div class="col">
|
|
<select id="epay_qq" class="col form-select"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['epay_qq'];?>
|
|
">
|
|
<option value="0">停用</option>
|
|
<option value="1" <?php if ($_smarty_tpl->getValue('settings')['epay_qq']) {?>selected<?php }?>>启用
|
|
</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">USDT</label>
|
|
<div class="col">
|
|
<select id="epay_usdt" class="col form-select"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['epay_usdt'];?>
|
|
">
|
|
<option value="0">停用</option>
|
|
<option value="1" <?php if ($_smarty_tpl->getValue('settings')['epay_usdt']) {?>selected<?php }?>>启用
|
|
</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="tab-pane" id="paypal">
|
|
<div class="card-body">
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">模式</label>
|
|
<div class="col">
|
|
<select id="paypal_mode" class="col form-select"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['paypal_mode'];?>
|
|
">
|
|
<option value="sandbox">Sandbox</option>
|
|
<option value="live"
|
|
<?php if ($_smarty_tpl->getValue('settings')['paypal_mode'] === 'live') {?>selected<?php }?>>Live
|
|
</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">PayPal客戶ID</label>
|
|
<div class="col">
|
|
<input id="paypal_client_id" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['paypal_client_id'];?>
|
|
">
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">PayPal客戶密钥</label>
|
|
<div class="col">
|
|
<input id="paypal_client_secret" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['paypal_client_secret'];?>
|
|
">
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">PayPal货币</label>
|
|
<div class="col">
|
|
<input id="paypal_currency" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['paypal_currency'];?>
|
|
">
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-3 row">
|
|
<label class="form-label col-3 col-form-label">PayPal语言</label>
|
|
<div class="col">
|
|
<input id="paypal_locale" type="text" class="form-control"
|
|
value="<?php echo $_smarty_tpl->getValue('settings')['paypal_locale'];?>
|
|
">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php echo '<script'; ?>
|
|
>
|
|
$("#save-setting").click(function () {
|
|
$.ajax({
|
|
url: '/admin/setting/billing',
|
|
type: 'POST',
|
|
dataType: "json",
|
|
data: {
|
|
<?php
|
|
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('update_field'), 'key');
|
|
$foreach1DoElse = true;
|
|
foreach ($_from ?? [] as $_smarty_tpl->getVariable('key')->value) {
|
|
$foreach1DoElse = false;
|
|
?>
|
|
<?php echo $_smarty_tpl->getValue('key');?>
|
|
: $('#<?php echo $_smarty_tpl->getValue('key');?>
|
|
').val(),
|
|
<?php
|
|
}
|
|
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
|
<?php
|
|
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('payment_gateways'), 'value', false, 'key');
|
|
$foreach2DoElse = true;
|
|
foreach ($_from ?? [] as $_smarty_tpl->getVariable('key')->value => $_smarty_tpl->getVariable('value')->value) {
|
|
$foreach2DoElse = false;
|
|
?>
|
|
<?php echo $_smarty_tpl->getValue('key');?>
|
|
: $("#<?php echo $_smarty_tpl->getValue('key');?>
|
|
_enable").is(":checked"),
|
|
<?php
|
|
}
|
|
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
|
},
|
|
success: function (data) {
|
|
if (data.ret === 1) {
|
|
$('#success-message').text(data.msg);
|
|
$('#success-dialog').modal('show');
|
|
} else {
|
|
$('#fail-message').text(data.msg);
|
|
$('#fail-dialog').modal('show');
|
|
}
|
|
}
|
|
})
|
|
});
|
|
<?php echo '</script'; ?>
|
|
>
|
|
|
|
<?php $_smarty_tpl->renderSubTemplate('file:admin/footer.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
|
|
}
|
|
}
|