mirror of
https://gitee.com/technical-laohu/mpay.git
synced 2025-09-17 09:16:40 +08:00
优化插件管理逻辑
This commit is contained in:
parent
c469680ae4
commit
1d55442388
@ -223,14 +223,14 @@ class PayController
|
||||
if ($config === false) return json(['code' => 4, 'msg' => '监听收款配置错误']);
|
||||
// 登陆账号
|
||||
$pay_config = ['username' => $config['account'], 'password' => $config['password']];
|
||||
// 收款查询
|
||||
$query = $config['query'];
|
||||
// 配置参数
|
||||
$params = $config['params'];
|
||||
// 实例监听客户端
|
||||
$payclient_name = $config['payclass'];
|
||||
$payclient_path = "\\payclient\\{$payclient_name}";
|
||||
$Payclient = new $payclient_path($pay_config);
|
||||
// 获取支付明细
|
||||
$records = $Payclient->getOrderInfo($query);
|
||||
$records = $Payclient->getOrderInfo($params);
|
||||
if ($records['code'] === 0) {
|
||||
// 提交收款记录
|
||||
$upres = $this->payHeart($records['data'], $config);
|
||||
|
@ -163,13 +163,13 @@ class PayManageController extends BaseController
|
||||
// 登陆账号
|
||||
$pay_config = ['username' => $config['account'], 'password' => $config['password']];
|
||||
// 收款查询
|
||||
$query = $config['query'];
|
||||
$params = $config['params'];
|
||||
// 实例监听客户端
|
||||
$payclient_name = $config['payclass'];
|
||||
$payclient_path = "\\payclient\\{$payclient_name}";
|
||||
$Payclient = new $payclient_path($pay_config);
|
||||
// 获取支付明细
|
||||
$records = $Payclient->getOrderInfo($query);
|
||||
$records = $Payclient->getOrderInfo($params);
|
||||
if ($records['code'] === 0) {
|
||||
// 收款流水
|
||||
return json(backMsg(0, '查询成功', $records['data']));
|
||||
|
@ -34,7 +34,6 @@ class PayAccount extends BaseModel
|
||||
$platform = PluginController::getPluginInfo($aid_info->getData('platform'));
|
||||
// 查询参数
|
||||
$params = json_decode($aid_info->params, true);
|
||||
$query = array_merge($platform['query'], $params);
|
||||
if ($aid_info && $platform) {
|
||||
$config = [
|
||||
'pid' => $aid_info->pid,
|
||||
@ -48,8 +47,8 @@ class PayAccount extends BaseModel
|
||||
'account' => $aid_info->account,
|
||||
// 密码
|
||||
'password' => $aid_info->password,
|
||||
// 订单查询参数配置
|
||||
'query' => $query,
|
||||
// 配置参数
|
||||
'params' => $params,
|
||||
];
|
||||
if ($pid !== null) {
|
||||
$pid_info = User::where('pid', $pid)->find();
|
||||
|
@ -13,9 +13,6 @@ return array (
|
||||
'describe' => '支持微信个人收款码、赞赏码、经营码、商家码收款,监听回调',
|
||||
'website' => 'https://weixin.qq.com/',
|
||||
'state' => 1,
|
||||
'query' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
1 =>
|
||||
array(
|
||||
@ -26,9 +23,6 @@ return array (
|
||||
'describe' => '支持支付宝个人收款码、经营码收款,监听回调',
|
||||
'website' => 'https://www.alipay.com/',
|
||||
'state' => 1,
|
||||
'query' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
2 =>
|
||||
array(
|
||||
@ -39,17 +33,6 @@ return array (
|
||||
'describe' => '主流移动支付全能收 信用卡,花呗都能用,生意帮手收钱吧,移动收款就用它!',
|
||||
'website' => 'https://www.shouqianba.com/',
|
||||
'state' => 1,
|
||||
'query' =>
|
||||
array (
|
||||
'date_end' => NULL,
|
||||
'date_start' => NULL,
|
||||
'page' => 1,
|
||||
'page_size' => 10,
|
||||
'upayQueryType' => 0,
|
||||
'status' => '2000',
|
||||
'store_sn' => '',
|
||||
'type' => '30',
|
||||
),
|
||||
),
|
||||
3 =>
|
||||
array(
|
||||
@ -60,8 +43,5 @@ return array (
|
||||
'describe' => '支付宝账单查询回调,免挂机,稳定不掉线',
|
||||
'website' => 'https://open.alipay.com/',
|
||||
'state' => 1,
|
||||
'query' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -126,10 +126,11 @@
|
||||
const field = data.field;
|
||||
(async () => {
|
||||
const saveRes = await fetch('/install/install', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(field) });
|
||||
if (saveRes.status != 200) { layer.msg('保存数据库配置失败'); return; }
|
||||
const saveJson = await saveRes.json();
|
||||
if (saveJson.code == 0) {
|
||||
const initRes = await fetch('/install/init', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(field) });
|
||||
if (initRes.status != 200) { layer.msg('初始化失败,请检查配置'); return; }
|
||||
if (initRes.status != 200) { layer.msg('初始化数据失败,请检查配置'); return; }
|
||||
const initJson = await initRes.json();
|
||||
if (initJson.code == 0) {
|
||||
layer.msg(initJson.msg, {
|
||||
|
Loading…
Reference in New Issue
Block a user