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