3 Commits

Author SHA1 Message Date
技术老胡
1f98974d5a 新增支付宝免输插件,修复一些小问题 2025-03-05 11:28:44 +08:00
技术老胡
a59a22fe82 修复异次元发卡通知回调问题 2025-03-04 17:27:05 +08:00
技术老胡
e3d7efa60f 更新PC端监听软件 2025-03-03 11:45:39 +08:00
10 changed files with 54 additions and 10 deletions

View File

@@ -408,7 +408,7 @@ V免签是一款开源免费适用于个人收款使用的收款程序原理
码支付微信PC监听是老胡使用python写的小工具可以监听电脑桌面打开的窗口和内容信息非侵入微信应用内部版本升级不影响监听。需要将被监听的微信聊天界面单独拖出来成独立窗口。 码支付微信PC监听是老胡使用python写的小工具可以监听电脑桌面打开的窗口和内容信息非侵入微信应用内部版本升级不影响监听。需要将被监听的微信聊天界面单独拖出来成独立窗口。
[PC监听软件下载wxmonitor.zip](assets/20250217_103606_wxmonitor.zip) [PC监听软件下载wxmonitor_v1.2.zip](assets/20250217_103606_wxmonitor_v1.2.zip)
##### 配置信息 ##### 配置信息

View File

@@ -13,7 +13,7 @@ class ConsoleController extends BaseController
// 后台主页 // 后台主页
public function index() public function index()
{ {
View::assign('version', 'v1'); View::assign('version', 'V1');
return View::fetch(); return View::fetch();
} }
// 管理菜单 // 管理菜单

View File

@@ -226,4 +226,22 @@ EOT;
$path = runtime_path() . 'install.lock'; $path = runtime_path() . 'install.lock';
file_put_contents($path, time()); file_put_contents($path, time());
} }
// 更新数据库结构
public function update()
{
// 连接数据库
$db = Db::connect();
// 查询 params 列的类型
$result = $db->query("SHOW COLUMNS FROM `mpay_pay_account` WHERE Field = 'params'");
if ($result && $result[0]['Type'] != 'text') {
// 如果不是 text 类型,则修改为 text 类型
$sql = "ALTER TABLE `mpay_pay_account` MODIFY COLUMN `params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '自定义查询' AFTER `pattern`;";
// 执行 SQL 语句更新数据库结构
$is_succ = $db->execute($sql);
if (!$is_succ) {
return json(backMsg(1, '数据库结构更新失败'));
}
}
return json(backMsg(0, '数据库结构检查并更新完成'));
}
} }

View File

@@ -66,7 +66,13 @@ class PayController
View::assign($act_order->toArray()); View::assign($act_order->toArray());
$passtime = strtotime($act_order->close_time) - time(); $passtime = strtotime($act_order->close_time) - time();
View::assign('passtime', $passtime > 0 ? $passtime : 0); View::assign('passtime', $passtime > 0 ? $passtime : 0);
View::assign('payUrl', $channel->qrcode); // Alipay免输
if (preg_match('/^alipay4#\d+$/', $channel->channel)) {
$payurl = \payclient\AliPayf::getPayUrl($act_order->order_id, $act_order->money, $channel->qrcode);
View::assign('payUrl', $payurl['data'] ?? $payurl['msg']);
} else {
View::assign('payUrl', $channel->qrcode);
}
View::assign('code_type', $channel->type); View::assign('code_type', $channel->type);
return View::fetch(); return View::fetch();
} else { } else {
@@ -165,8 +171,16 @@ class PayController
$is_money = $order->really_price == $new_order['price']; $is_money = $order->really_price == $new_order['price'];
// 订单核对 // 订单核对
if ($is_payway && $is_channel && $is_money) { if ($is_payway && $is_channel && $is_money) {
$res = $this->updateOrderState($order, $new_order['order_no']); // 是否免输
$notify[] = $res; if (isset($new_order['remark'])) {
if ($new_order['remark'] == $order->order_id) {
$res = $this->updateOrderState($order, $new_order['order_no']);
$notify[] = $res;
}
} else {
$res = $this->updateOrderState($order, $new_order['order_no']);
$notify[] = $res;
}
} }
} }
} }
@@ -320,6 +334,10 @@ class PayController
// 添加扩展参数 // 添加扩展参数
// $notify = array_merge($notify, unserialize($param->param)); // $notify = array_merge($notify, unserialize($param->param));
$notify['param'] = unserialize($param->param); $notify['param'] = unserialize($param->param);
// 删除空值
foreach ($notify as $key => $val) {
if ($val === '') unset($notify[$key]);
}
return $notify; return $notify;
} }
// 请求外部资源 // 请求外部资源

View File

@@ -162,6 +162,10 @@ class OrderController extends BaseController
// 添加扩展参数 // 添加扩展参数
// $notify = array_merge($notify, unserialize($param->param)); // $notify = array_merge($notify, unserialize($param->param));
$notify['param'] = unserialize($param->param); $notify['param'] = unserialize($param->param);
// 删除空值
foreach ($notify as $key => $val) {
if ($val === '') unset($notify[$key]);
}
return $notify; return $notify;
} }
// 请求外部资源 // 请求外部资源

View File

@@ -37,7 +37,7 @@ class Order extends BaseModel
// 商品金额 // 商品金额
'money' => $data['money'], 'money' => $data['money'],
// 实际成交金额 // 实际成交金额
'really_price' => self::checkMoney($data['money'], $data['type'], $channel['aid'], $channel['cid']), 'really_price' => self::checkMoney($data['money'], $data['type'], $channel['aid'], $channel['cid'], $channel['chan']),
// 用户IP // 用户IP
'clientip' => isset($data['clientip']) ? $data['clientip'] : '', 'clientip' => isset($data['clientip']) ? $data['clientip'] : '',
// 设备类型 // 设备类型
@@ -145,7 +145,7 @@ class Order extends BaseModel
if (!$channel_info) return backMsg(3, '用户账户无可用收款通道'); if (!$channel_info) return backMsg(3, '用户账户无可用收款通道');
// 选取收款通道 // 选取收款通道
$patt = PayAccount::find($channel_info->account_id); $patt = PayAccount::find($channel_info->account_id);
$channel = ['aid' => $channel_info->account_id, 'cid' => $channel_info->id, 'patt' => $patt->getData('pattern')]; $channel = ['aid' => $channel_info->account_id, 'cid' => $channel_info->id, 'patt' => $patt->getData('pattern'), 'chan' => $channel_info->channel];
PayChannel::update(['last_time' => self::getFormatTime(), 'id' => $channel['cid']]); PayChannel::update(['last_time' => self::getFormatTime(), 'id' => $channel['cid']]);
return backMsg(0, 'ok', $channel); return backMsg(0, 'ok', $channel);
} }
@@ -162,9 +162,13 @@ class Order extends BaseModel
// return $params; // return $params;
// } // }
// 检查金额 // 检查金额
private static function checkMoney($money, $type, $aid, $cid): float private static function checkMoney($money, $type, $aid, $cid, $chan): float
{ {
$money = (float) $money; $money = (float) $money;
// Alipay免输
if (preg_match('/^alipay4#\d+$/', $chan)) {
return $money;
}
// 查询有效订单 // 查询有效订单
$query = self::scope('activeOrder')->where(['type' => $type, 'aid' => $aid, 'cid' => $cid]); $query = self::scope('activeOrder')->where(['type' => $type, 'aid' => $aid, 'cid' => $cid]);
$activeOrders = $query->column('really_price'); $activeOrders = $query->column('really_price');

Binary file not shown.

Binary file not shown.

View File

@@ -82,7 +82,7 @@
<div class="layui-side-scroll"> <div class="layui-side-scroll">
<div id="sideMenu"></div> <div id="sideMenu"></div>
</div> </div>
<div id="version"><p>版本号:<?php echo $version ?></p><p>by techhaha</p></div> <div id="version"><p>版本号:<?php echo $version ?></p><p>by 技术老胡</p></div>
</div> </div>
<!-- 视 图 页 面 --> <!-- 视 图 页 面 -->
<div class="layui-body"> <div class="layui-body">

View File

@@ -180,7 +180,7 @@
} }
</script> </script>
<script> <script>
const payCode = '<?php echo htmlentities($payUrl); ?>'; const payCode = '<?php echo $payUrl; ?>';
const codeType = '<?php echo htmlentities($code_type); ?>'; const codeType = '<?php echo htmlentities($code_type); ?>';
const payType = '<?php echo htmlentities($type); ?>'; const payType = '<?php echo htmlentities($type); ?>';
const order = '<?php echo htmlentities($order_id); ?>'; const order = '<?php echo htmlentities($order_id); ?>';