16 Commits

Author SHA1 Message Date
技术老胡
67153084c8 更新 2025-02-17 11:32:33 +08:00
技术老胡
686227eeba 更新 2025-02-17 11:22:12 +08:00
技术老胡
9791b0c017 更新 2025-02-17 11:16:45 +08:00
技术老胡
023c05e5e3 更新文档 2025-02-17 11:15:15 +08:00
技术老胡
fc35815ae4 更新文档 2025-02-17 11:10:42 +08:00
技术老胡
df6b7f7c22 更新文档 2025-02-17 11:02:43 +08:00
技术老胡
06a062546c 更新文档 2025-02-13 21:10:56 +08:00
技术老胡
f03d3de109 添加收款码设置说明 2025-02-08 11:37:14 +08:00
技术老胡
b546977011 更新PC端监控逻辑 2025-02-08 10:53:26 +08:00
技术老胡
9080543df4 更新文档 2025-02-06 18:34:12 +08:00
技术老胡
a4b8381395 更新文档 2025-01-24 15:51:58 +08:00
技术老胡
020398b34f 更新 2025-01-24 15:44:53 +08:00
技术老胡
a7ca3d2db5 更新文档 2025-01-24 15:42:30 +08:00
技术老胡
5d42d2ef70 更新 2025-01-22 17:08:30 +08:00
技术老胡
9fbedc8cfc 更新文件 2025-01-20 10:30:53 +08:00
技术老胡
b56156d33a 更新手动补单问题 2025-01-20 10:00:07 +08:00
19 changed files with 119 additions and 55 deletions

8
.env
View File

@@ -1,12 +1,12 @@
APP_DEBUG = true
APP_DEBUG = false
DB_TYPE = mysql
DB_HOST = 127.0.0.1
DB_NAME = mpay
DB_USER = admin
DB_PASS = Aa123456
DB_USER = mpay
DB_PASS = 123456
DB_PORT = 3306
DB_CHARSET = utf8
DB_CHARSET = utf8mb4
DB_PREFIX = mpay_
DEFAULT_LANG = zh-cn

14
.gitignore vendored
View File

@@ -1,6 +1,12 @@
/.idea
/.vscode
/.history
/.gitee
.vscode
*.env
extend/*
!extend/ImgCaptcha.php
!extend/payclient.zip
!extend/Plugin.php
vendor/*
!vendor/vendor.zip
runtime/*

View File

@@ -319,9 +319,9 @@ V免签是一款开源免费适用于个人收款使用的收款程序原理
### 挂机监听收款通知
`微信支付``支付宝`需要手机挂机监听收款通知,并通知服务器收款信息,也是最常见的解决方案
收款通知信息需要挂机监听,有`手机监听``PC监听`两种手机可以同时监听微信和支付宝PC只能监听微信具体支持的通知和功能在设置账号页面有详细介绍。
#### 软件下软(安卓)
#### 🚀️ 手机软件下软(安卓)
码支付使用的是开源工具**短信转发器**`SmsForwarder`来监听收款通知,`SmsForwarder`功能非常强大,喜欢*搞机* 的朋友可以多钻研,这是使用文档[短信转发器](https://gitee.com/pp/SmsForwarder/wikis/pages)
@@ -333,7 +333,7 @@ V免签是一款开源免费适用于个人收款使用的收款程序原理
---
#### 🚀️ 功能配置
##### 功能配置
找一台不常用的安卓系统手机,下载安装好`SmsForwarder`之后,点开进行配置,同时打开码支付后台**用户中心**页面,查看相关配置参数
@@ -403,7 +403,36 @@ V免签是一款开源免费适用于个人收款使用的收款程序原理
![](assets/20241204_173046_image.png)
#### 收款通知测试
#### 🚀️ PC软件下载
码支付微信PC监听是老胡使用python写的小工具可以监听电脑桌面打开的窗口和内容信息非侵入微信应用内部版本升级不影响监听。需要将被监听的微信聊天界面单独拖出来成独立窗口。
[PC监听软件下载wxmonitor.zip](assets/20250217_103606_wxmonitor.zip)
##### 配置信息
1. 打开用户中心,添加接口密钥等信息
![](assets/20250217_104137_image.png)
2. 打开账号管理列表,填写通道信息,格式`pid#aid`
![](assets/20250217_104349_image.png)
3. 循环间隔是软件检索窗口通知信息的循环时间一般设置1-3秒均可看电脑性能
4. 监控窗口根据实际情况勾选,哪个窗口需要检索收款通知,就开启哪个,不使用的就不需要开启
![](assets/20250217_105144_image.png)
5. PC监听同时支持个人码、经营码、赞赏码、商户码**手机监听因无法区分个人码和经营码,添加时只能二选一,且只能在`个人码`通道添加**。
![](assets/20250217_105939_image.png)
7. PC监听和手机监听只需要开启一个即可不要同时开启会出现重复通知导致订单异常。
---
@@ -436,3 +465,31 @@ V免签是一款开源免费适用于个人收款使用的收款程序原理
![订单详情](assets/20241203_155123_image.png)
# 学习交流社群
社群答疑、插件定制、技术交流,添加微信拉群,请备注:**码支付**
微信:**K103516**
<img src="assets/wxqrcode.png" width=50% />
## 感谢赞助
<img src="assets/20250217_111408_1739762042428.jpg" width=35% />
|姓名 | 金额 |
|---|---|
| 知汇学社 | 100 |
| exrock | 100 |
| A筱磊 | 6.66 |
| 云峰 | 8.88 |
| 零零 | 200 |
## 友情链接
1. [腾飞博客专业WP子比主题美化定制](https://calfbxtoi72.feishu.cn/docx/DA3ddthzOolQ16xDgeOcHA36nrg)

View File

@@ -97,12 +97,8 @@ class PayController
$sign = self::getSign($notify, $user_key);
$notify['sign'] = $sign;
// 跳转通知URL
$res_return_url = '';
if (strpos($act_order->return_url, '?')) {
$res_return_url = $act_order->return_url . '&' . http_build_query($notify);
} else {
$res_return_url = $act_order->return_url . '?' . http_build_query($notify);
}
$res_return_url = $act_order->return_url . '?' . http_build_query($notify);
if (strpos($act_order->return_url, '?')) $res_return_url = $act_order->return_url . '&' . http_build_query($notify);
// 响应消息
$data['order_id'] = $act_order->order_id;
$data['passtime'] = $passtime > 0 ? $passtime : 0;
@@ -192,12 +188,8 @@ class PayController
$sign = self::getSign($notify, $user_key);
$notify['sign'] = $sign;
// 异步通知
$notify_url = '';
if (strpos($order->notify_url, '?')) {
$notify_url = $order->notify_url . '&' . http_build_query($notify);
} else {
$notify_url = $order->notify_url . '?' . http_build_query($notify);
}
$notify_url = $order->notify_url . '?' . http_build_query($notify);
if (strpos($order->notify_url, '?')) $notify_url = $order->notify_url . '&' . http_build_query($notify);
$res_notify = self::getHttpResponse($notify_url);
if ($res_notify === 'success') {
return ['order' => $order->order_id, 'code' => 1, 'msg' => 'notify success'];
@@ -280,20 +272,18 @@ class PayController
{
$info = $request->post();
$action = isset($info['action']) ? $info['action'] : '';
if ($action === 'mpay') {
$data = json_decode($info['data'], true);
if (!is_array($data)) return 200;
if (!isset($data['aid']) || !isset($data['pid'])) return 202;
$config = PayAccount::getAccountConfig($data['aid'], $data['pid']);
$payclient_path = "\\payclient\\{$config['payclass']}";
$Payclient = new $payclient_path($info, $config);
$res = $Payclient->notify();
if (is_int($res)) return $res;
$this->payHeart($res, $config);
return 200;
} else {
return 202;
}
if ($action !== 'mpay' && $action !== 'mpaypc') return '非mpay的访问请求';
$data = json_decode($info['data'], true);
if (!is_array($data)) return '通知数据为空';
if (!isset($data['aid']) || !isset($data['pid'])) return 'aid和pid参数错误';
$config = PayAccount::getAccountConfig($data['aid'], $data['pid']);
$payclient_path = "\\payclient\\{$config['payclass']}";
$Payclient = new $payclient_path($info, $config);
if ($action == 'mpay') $res = $Payclient->notify();
if ($action == 'mpaypc') $res = $Payclient->pcNotify();
if ($res['code'] !== 0) return $res['msg'];
$this->payHeart($res['data'], $config);
return 200;
}
// 签名
private static function getSign(array $param = [], string $key = ''): string

View File

@@ -48,7 +48,9 @@ class OrderController extends BaseController
$sign = self::getSign($notify, $user_key);
$notify['sign'] = $sign;
// 异步通知
$res_notify = self::getHttpResponse($order->notify_url . '?' . http_build_query($notify));
$notify_url = $order->notify_url . '?' . http_build_query($notify);
if (strpos($order->notify_url, '?')) $notify_url = $order->notify_url . '&' . http_build_query($notify);
$res_notify = self::getHttpResponse($notify_url);
if ($res_notify === 'success') {
return json(\backMsg(0, '订单通知成功'));
} else {
@@ -72,7 +74,9 @@ class OrderController extends BaseController
$sign = self::getSign($notify, $user_key);
$notify['sign'] = $sign;
// 异步通知
$res_notify = self::getHttpResponse($order->notify_url . '?' . http_build_query($notify));
$notify_url = $order->notify_url . '?' . http_build_query($notify);
if (strpos($order->notify_url, '?')) $notify_url = $order->notify_url . '&' . http_build_query($notify);
$res_notify = self::getHttpResponse($notify_url);
if ($res_notify === 'success') {
return json(\backMsg(0, '订单通知成功'));
} else {
@@ -156,7 +160,8 @@ class OrderController extends BaseController
'sign_type' => 'MD5',
];
// 添加扩展参数
$notify = array_merge($notify, unserialize($param->param));
// $notify = array_merge($notify, unserialize($param->param));
$notify['param'] = unserialize($param->param);
return $notify;
}
// 请求外部资源

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

BIN
assets/wxqrcode.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 KiB

1
extend/.gitignore vendored
View File

@@ -1 +0,0 @@
payclient

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

2
runtime/.gitignore vendored
View File

@@ -1,2 +0,0 @@
*
!.gitignore

3
vendor/.gitignore vendored
View File

@@ -1,3 +0,0 @@
*
!.gitignore
!vendor.zip

View File

@@ -39,10 +39,10 @@
lay-filter="scanning" class="layui-input" data-type="">
</div>
</div>
</div>
<div class="main-container">
<div class="layui-text">
<p>终端编号如何填写,<strong><a href="https://f0bmwzqjtq2.feishu.cn/docx/HBVrdrsACo36bzxUCSPcjOBNnyb?from=from_copylink" target="_blank"><strong>请查看文档</strong></a></p>
<div class="layui-form-item">
<blockquote class="layui-elem-quote">
<p>首次添加,不知道终端编号可以先空着,后面再查询填写。查询终端编号,<strong><a class="layui-font-blue" href="https://f0bmwzqjtq2.feishu.cn/docx/HBVrdrsACo36bzxUCSPcjOBNnyb?from=from_copylink" target="_blank"><strong>请查看文档</strong></a></p>
</blockquote>
</div>
</div>
</div>

View File

@@ -28,14 +28,14 @@
<select class="type" lay-filter="select-type">
<option value="">请选择</option>
<!-- <?php if ($platform == 'wxpay') { ?> -->
<option value="wxpay1">个人码/经营码</option>
<option value="wxpay1">个人码</option>
<option value="wxpay2">赞赏码</option>
<option value="wxpay3" disabled >经营码</option>
<option value="wxpay3">经营码</option>
<option value="wxpay4">商家码</option>
<!-- <?php } ?> -->
<!-- <?php if ($platform == 'alipay') { ?> -->
<option value="alipay1">收钱码/经营码</option>
<option value="alipay2" disabled>经营码</option>
<option value="alipay1">收钱码</option>
<option value="alipay2">经营码</option>
<!-- <?php } ?> -->
</select>
</div>
@@ -57,6 +57,18 @@
lay-filter="scanning" class="layui-input" data-type="">
</div>
</div>
<div class="layui-form-item">
<blockquote class="layui-elem-quote">
<!-- <?php if ($platform == 'wxpay') { ?> -->
<p><strong>手机监控:</strong>微信个人码与经营码只能二选一,不能同时添加,商家码监听需要关注“微信收款商业版”公众号,赞赏码正常添加。</p>
<p><strong>电脑监控:</strong>所有收款码均可监控,将需要将收款通知聊天窗口单独拖出来</p>
<!-- <?php } ?> -->
<!-- <?php if ($platform == 'alipay') { ?> -->
<p><strong>手机监控:</strong>支付宝收钱码与经营码只能二选一</p>
<p><strong>电脑监控:</strong>暂不支持PC端监控可以选择支付宝账单方式监听收款</p>
<!-- <?php } ?> -->
</blockquote>
</div>
</div>
</div>
<div class="bottom">