Compare commits
16 Commits
v1.1.4
...
67153084c8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67153084c8 | ||
|
|
686227eeba | ||
|
|
9791b0c017 | ||
|
|
023c05e5e3 | ||
|
|
fc35815ae4 | ||
|
|
df6b7f7c22 | ||
|
|
06a062546c | ||
|
|
f03d3de109 | ||
|
|
b546977011 | ||
|
|
9080543df4 | ||
|
|
a4b8381395 | ||
|
|
020398b34f | ||
|
|
a7ca3d2db5 | ||
|
|
5d42d2ef70 | ||
|
|
9fbedc8cfc | ||
|
|
b56156d33a |
8
.env
@@ -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
@@ -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/*
|
||||
65
README.md
@@ -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免签是一款开源免费适用于个人收款使用的收款程序,原理
|
||||
|
||||

|
||||
|
||||
#### 收款通知测试
|
||||
#### 🚀️ PC软件下载
|
||||
|
||||
码支付微信PC监听,是老胡使用python写的小工具,可以监听电脑桌面打开的窗口和内容信息,非侵入微信应用内部,版本升级不影响监听。需要将被监听的微信聊天界面单独拖出来成独立窗口。
|
||||
|
||||
[PC监听软件下载wxmonitor.zip](assets/20250217_103606_wxmonitor.zip)
|
||||
|
||||
##### 配置信息
|
||||
|
||||
1. 打开用户中心,添加接口密钥等信息
|
||||
|
||||

|
||||
|
||||
2. 打开账号管理列表,填写通道信息,格式`pid#aid`
|
||||
|
||||

|
||||
|
||||
3. 循环间隔是软件检索窗口通知信息的循环时间,一般设置1-3秒均可,看电脑性能
|
||||
4. 监控窗口根据实际情况勾选,哪个窗口需要检索收款通知,就开启哪个,不使用的就不需要开启
|
||||
|
||||

|
||||
|
||||
5. PC监听同时支持个人码、经营码、赞赏码、商户码,**手机监听因无法区分个人码和经营码,添加时只能二选一,且只能在`个人码`通道添加**。
|
||||
|
||||

|
||||
|
||||
7. PC监听和手机监听,只需要开启一个即可,不要同时开启,会出现重复通知,导致订单异常。
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
@@ -436,3 +465,31 @@ V免签是一款开源免费适用于个人收款使用的收款程序,原理
|
||||
|
||||

|
||||
|
||||
# 学习交流社群
|
||||
|
||||
社群答疑、插件定制、技术交流,添加微信拉群,请备注:**码支付**
|
||||
|
||||
微信:**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)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
// 请求外部资源
|
||||
|
||||
BIN
assets/20250217_103606_wxmonitor.zip
Normal file
BIN
assets/20250217_104137_image.png
Normal file
|
After Width: | Height: | Size: 245 KiB |
BIN
assets/20250217_104349_image.png
Normal file
|
After Width: | Height: | Size: 207 KiB |
BIN
assets/20250217_105144_image.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
assets/20250217_105939_image.png
Normal file
|
After Width: | Height: | Size: 149 KiB |
BIN
assets/20250217_111408_1739762042428.jpg
Normal file
|
After Width: | Height: | Size: 81 KiB |
BIN
assets/wxqrcode.png
Normal file
|
After Width: | Height: | Size: 330 KiB |
1
extend/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
payclient
|
||||
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
2
runtime/.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
*
|
||||
!.gitignore
|
||||
3
vendor/.gitignore
vendored
@@ -1,3 +0,0 @@
|
||||
*
|
||||
!.gitignore
|
||||
!vendor.zip
|
||||
@@ -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>
|
||||
|
||||
@@ -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">
|
||||
|
||||