mirror of
https://gitee.com/technical-laohu/mpay.git
synced 2025-11-09 20:23:43 +08:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ac1c2fd13 | ||
|
|
d570aa88b3 | ||
|
|
a05a5710af | ||
|
|
b3dd6ba3f0 | ||
|
|
d0dd5a3f9b | ||
|
|
ccb94768d3 | ||
|
|
7c35519e65 | ||
|
|
d0fe56bade | ||
|
|
0a270541c7 | ||
|
|
62181cf33d | ||
|
|
1f98974d5a | ||
|
|
a59a22fe82 | ||
|
|
e3d7efa60f |
2
.env
2
.env
@@ -1,4 +1,4 @@
|
|||||||
APP_DEBUG = true
|
APP_DEBUG = false
|
||||||
|
|
||||||
DB_TYPE = mysql
|
DB_TYPE = mysql
|
||||||
DB_HOST = 127.0.0.1
|
DB_HOST = 127.0.0.1
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|
||||||
##### 配置信息
|
##### 配置信息
|
||||||
|
|
||||||
@@ -444,6 +444,7 @@ V免签是一款开源免费适用于个人收款使用的收款程序,原理
|
|||||||
社群答疑、插件定制、技术交流,添加微信拉群,请备注:**码支付**
|
社群答疑、插件定制、技术交流,添加微信拉群,请备注:**码支付**
|
||||||
|
|
||||||
微信:**K103516**
|
微信:**K103516**
|
||||||
|
备用:**HU1094551889**
|
||||||
|
|
||||||
<img src="assets/wxqrcode.png" width=480 />
|
<img src="assets/wxqrcode.png" width=480 />
|
||||||
|
|
||||||
@@ -460,6 +461,8 @@ V免签是一款开源免费适用于个人收款使用的收款程序,原理
|
|||||||
| 云峰 | 8.88 |
|
| 云峰 | 8.88 |
|
||||||
| 零零 | 200 |
|
| 零零 | 200 |
|
||||||
| 子染 | 88 |
|
| 子染 | 88 |
|
||||||
|
| John | 100 |
|
||||||
|
| 辰起 | 8.88 |
|
||||||
|
|
||||||
## 🔗 友情链接
|
## 🔗 友情链接
|
||||||
|
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
// 管理菜单
|
// 管理菜单
|
||||||
@@ -28,6 +28,12 @@ class ConsoleController extends BaseController
|
|||||||
{
|
{
|
||||||
// 加载菜单配置
|
// 加载菜单配置
|
||||||
$message = \Plugin::getNotifyMessage();
|
$message = \Plugin::getNotifyMessage();
|
||||||
|
if (empty($message)) {
|
||||||
|
$message = [
|
||||||
|
["id" => 1, "title" => "应用更新", "children" => []],
|
||||||
|
["id" => 2, "title" => "官方消息", "children" => []],
|
||||||
|
];
|
||||||
|
}
|
||||||
return json($message);
|
return json($message);
|
||||||
}
|
}
|
||||||
// 首页仪表盘
|
// 首页仪表盘
|
||||||
|
|||||||
@@ -7,85 +7,178 @@ namespace app\controller;
|
|||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
use think\Request;
|
use think\Request;
|
||||||
use think\facade\View;
|
use think\facade\View;
|
||||||
|
use think\facade\Log;
|
||||||
|
use think\exception\ValidateException;
|
||||||
|
use think\Validate;
|
||||||
|
|
||||||
class InstallController
|
class InstallController
|
||||||
{
|
{
|
||||||
|
private const INSTALL_LOCK_FILE = 'install.lock';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 连接数据库
|
||||||
|
* @return \think\db\Connection
|
||||||
|
*/
|
||||||
|
private function connectDatabase()
|
||||||
|
{
|
||||||
|
return Db::connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页,检查是否已安装,若已安装则跳转到登录页,否则显示安装页面
|
||||||
|
* @return \think\response\Redirect|\think\response\View
|
||||||
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
// 检查是否已经安装过
|
|
||||||
if ($this->checkLock()) {
|
if ($this->checkLock()) {
|
||||||
return redirect('User/login');
|
return redirect('User/login');
|
||||||
};
|
}
|
||||||
return View::fetch();
|
return View::fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安装操作,检查环境、保存数据库配置信息
|
||||||
|
* @param Request $request
|
||||||
|
* @return \think\response\Json
|
||||||
|
*/
|
||||||
public function install(Request $request)
|
public function install(Request $request)
|
||||||
{
|
{
|
||||||
// 检查是否已经安装过
|
|
||||||
if ($this->checkLock()) {
|
if ($this->checkLock()) {
|
||||||
return json(backMsg(1, '已经安装'));
|
return json(backMsg(1, '已经安装'));
|
||||||
};
|
}
|
||||||
// 检查环境
|
|
||||||
$envCheck = $this->checkEnvironment();
|
$envCheck = $this->checkEnvironment();
|
||||||
if ($envCheck !== true) {
|
if ($envCheck !== true) {
|
||||||
return json(backMsg(1, $envCheck));
|
return json(backMsg(1, $envCheck));
|
||||||
};
|
}
|
||||||
// 获取表单提交的数据库配置信息
|
|
||||||
$dbConfig = $request->post();
|
$dbConfig = $request->post();
|
||||||
// 保存数据库配置信息到配置文件
|
try {
|
||||||
if ($this->saveDbConfig($dbConfig) === false) {
|
$this->validateDbConfig($dbConfig);
|
||||||
return json(backMsg(1, '配置保存失败'));
|
$this->saveDbConfig($dbConfig);
|
||||||
} else {
|
|
||||||
return json(backMsg(0, '配置保存成功'));
|
return json(backMsg(0, '配置保存成功'));
|
||||||
};
|
} catch (ValidateException $e) {
|
||||||
|
return json(backMsg(1, $e->getMessage()));
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Log::error("保存数据库配置失败: " . $e->getMessage());
|
||||||
|
return json(backMsg(1, '配置保存失败'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 初始化数据库
|
|
||||||
|
/**
|
||||||
|
* 初始化数据库,创建表并初始化数据
|
||||||
|
* @param Request $request
|
||||||
|
* @return \think\response\Json
|
||||||
|
*/
|
||||||
public function init(Request $request)
|
public function init(Request $request)
|
||||||
{
|
{
|
||||||
// 检查是否已经安装过
|
|
||||||
if ($this->checkLock()) {
|
if ($this->checkLock()) {
|
||||||
return backMsg(1, '已经安装');
|
return json(backMsg(1, '已经安装'));
|
||||||
};
|
}
|
||||||
// 获取表单提交的数据库配置信息
|
|
||||||
$dbConfig = $request->post();
|
$dbConfig = $request->post();
|
||||||
|
$startTime = microtime(true);
|
||||||
|
|
||||||
// 连接数据库并建表
|
try {
|
||||||
$is_succ_tb = $this->createTables();
|
$this->validateInitData($dbConfig);
|
||||||
|
$this->connectDatabase()->transaction(function () use ($dbConfig) {
|
||||||
// 初始化数据记录
|
$this->createTables();
|
||||||
$is_succ_data = $this->initData($dbConfig);
|
$this->initData($dbConfig);
|
||||||
|
});
|
||||||
// 安装检测
|
$this->setLock();
|
||||||
if (!$is_succ_tb) {
|
$endTime = microtime(true);
|
||||||
return json(backMsg(1, '数据表创建失败'));
|
Log::info("数据库初始化完成,耗时: " . ($endTime - $startTime) . " 秒");
|
||||||
|
return json(backMsg(0, '安装成功'));
|
||||||
|
} catch (ValidateException $e) {
|
||||||
|
return json(backMsg(1, $e->getMessage()));
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Log::error("数据库初始化失败: " . $e->getMessage());
|
||||||
|
return json(backMsg(1, '数据库初始化失败'));
|
||||||
}
|
}
|
||||||
if (!$is_succ_data) {
|
|
||||||
return json(backMsg(1, '数据初始化失败'));
|
|
||||||
}
|
|
||||||
// 安装成功,写入安装锁文件
|
|
||||||
$this->setLock();
|
|
||||||
return json(backMsg(0, '安装成功'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查环境,包括 PHP 版本、文件上传写入权限、Fileinfo 扩展
|
||||||
|
* @return bool|string
|
||||||
|
*/
|
||||||
private function checkEnvironment()
|
private function checkEnvironment()
|
||||||
{
|
{
|
||||||
// 检查PHP版本
|
|
||||||
if (version_compare(PHP_VERSION, '8.0', '<')) {
|
if (version_compare(PHP_VERSION, '8.0', '<')) {
|
||||||
return 'PHP版本必须大于等于8.0';
|
return 'PHP 版本必须大于等于 8.0';
|
||||||
}
|
}
|
||||||
// 检查文件上传写入权限
|
|
||||||
if (!is_writable(sys_get_temp_dir())) {
|
if (!is_writable(sys_get_temp_dir())) {
|
||||||
return '文件上传目录没有写入权限';
|
return '文件上传目录没有写入权限';
|
||||||
}
|
}
|
||||||
// 检查Fileinfo扩展是否安装
|
|
||||||
if (!extension_loaded('fileinfo')) {
|
if (!extension_loaded('fileinfo')) {
|
||||||
return 'Fileinfo扩展未安装';
|
return 'Fileinfo 扩展未安装';
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
private function saveDbConfig($dbConfig)
|
|
||||||
|
/**
|
||||||
|
* 验证数据库配置信息
|
||||||
|
* @param array $dbConfig
|
||||||
|
* @throws ValidateException
|
||||||
|
*/
|
||||||
|
private function validateDbConfig(array $dbConfig)
|
||||||
|
{
|
||||||
|
$validate = new Validate();
|
||||||
|
$rule = [
|
||||||
|
'host' => 'require',
|
||||||
|
'name' => 'require',
|
||||||
|
'user' => 'require',
|
||||||
|
'pass' => 'require',
|
||||||
|
'port' => 'require|integer',
|
||||||
|
'charset' => 'require'
|
||||||
|
];
|
||||||
|
if (!$validate->rule($rule)->check($dbConfig)) {
|
||||||
|
throw new ValidateException($validate->getError());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证初始化数据信息
|
||||||
|
* @param array $dbConfig
|
||||||
|
* @throws ValidateException
|
||||||
|
*/
|
||||||
|
private function validateInitData(array $dbConfig)
|
||||||
|
{
|
||||||
|
$validate = new Validate();
|
||||||
|
$rule = [
|
||||||
|
'nickname' => 'require',
|
||||||
|
'username' => 'require',
|
||||||
|
'password' => 'require'
|
||||||
|
];
|
||||||
|
if (!$validate->rule($rule)->check($dbConfig)) {
|
||||||
|
throw new ValidateException($validate->getError());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存数据库配置信息到 .env 文件
|
||||||
|
* @param array $dbConfig
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
private function saveDbConfig(array $dbConfig)
|
||||||
{
|
{
|
||||||
$envPath = app()->getRootPath() . '.env';
|
$envPath = app()->getRootPath() . '.env';
|
||||||
$envContent = <<<EOT
|
$envContent = $this->generateEnvContent($dbConfig);
|
||||||
|
if (file_put_contents($envPath, $envContent) === false) {
|
||||||
|
throw new \Exception("无法写入 .env 文件");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成 .env 文件内容
|
||||||
|
* @param array $dbConfig
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function generateEnvContent(array $dbConfig): string
|
||||||
|
{
|
||||||
|
return <<<EOT
|
||||||
APP_DEBUG = false
|
APP_DEBUG = false
|
||||||
|
|
||||||
DB_TYPE = mysql
|
DB_TYPE = mysql
|
||||||
@@ -99,131 +192,172 @@ DB_PREFIX = mpay_
|
|||||||
|
|
||||||
DEFAULT_LANG = zh-cn
|
DEFAULT_LANG = zh-cn
|
||||||
EOT;
|
EOT;
|
||||||
return file_put_contents($envPath, $envContent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建数据库表
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
private function createTables()
|
private function createTables()
|
||||||
{
|
{
|
||||||
// 连接数据库
|
$db = $this->connectDatabase();
|
||||||
$db = Db::connect();
|
$tables = $this->getTableCreationSqls();
|
||||||
if ($db === false) {
|
|
||||||
return false;
|
foreach ($tables as $tableName => $sql) {
|
||||||
|
try {
|
||||||
|
$db->execute("DROP TABLE IF EXISTS `$tableName`;");
|
||||||
|
$db->execute($sql);
|
||||||
|
Log::info("$tableName 表创建成功");
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
throw new \Exception("创建 $tableName 表失败: " . $e->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 创建order表的 SQL 语句
|
|
||||||
$sql = "CREATE TABLE `mpay_order` (
|
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`pid` int(11) NOT NULL DEFAULT '0' COMMENT '商户ID',
|
|
||||||
`order_id` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '订单号',
|
|
||||||
`type` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '支付类型',
|
|
||||||
`out_trade_no` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '商户订单号',
|
|
||||||
`notify_url` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '异步通知地址',
|
|
||||||
`return_url` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '跳转通知地址',
|
|
||||||
`name` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '商品名称',
|
|
||||||
`really_price` float NOT NULL DEFAULT '0' COMMENT '实际支付金额',
|
|
||||||
`money` float NOT NULL DEFAULT '0' COMMENT '订单价格',
|
|
||||||
`clientip` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '用户IP地址',
|
|
||||||
`device` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '设备类型',
|
|
||||||
`param` varchar(720) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '扩展参数',
|
|
||||||
`state` tinyint(4) NOT NULL DEFAULT '0' COMMENT '订单状态',
|
|
||||||
`patt` tinyint(4) NOT NULL DEFAULT '0' COMMENT '开启回调监听',
|
|
||||||
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '订单创建时间',
|
|
||||||
`close_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '订单关闭时间',
|
|
||||||
`pay_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '支付时间',
|
|
||||||
`platform_order` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '收款平台订单号',
|
|
||||||
`aid` int(11) NOT NULL DEFAULT '0' COMMENT '收款账号ID',
|
|
||||||
`cid` int(11) NOT NULL DEFAULT '0' COMMENT '收款码ID',
|
|
||||||
`delete_time` timestamp NULL DEFAULT NULL COMMENT '软删除',
|
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;";
|
|
||||||
|
|
||||||
// 执行 SQL 语句创建表
|
|
||||||
$db->execute("DROP TABLE IF EXISTS `mpay_order`;");
|
|
||||||
$db->execute($sql);
|
|
||||||
|
|
||||||
// 创建pay_account表的 SQL 语句
|
|
||||||
$sql = "CREATE TABLE `mpay_pay_account` (
|
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '收款平台ID',
|
|
||||||
`pid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
|
|
||||||
`platform` varchar(255) NOT NULL DEFAULT '' COMMENT '收款平台',
|
|
||||||
`account` varchar(255) NOT NULL DEFAULT '' COMMENT '账号',
|
|
||||||
`password` varchar(255) NOT NULL DEFAULT '' COMMENT '密码',
|
|
||||||
`state` tinyint(4) NOT NULL DEFAULT '1' COMMENT '启用',
|
|
||||||
`pattern` tinyint(4) NOT NULL DEFAULT '1' COMMENT '账号监听模式',
|
|
||||||
`params` text NOT NULL COMMENT '自定义查询',
|
|
||||||
`delete_time` timestamp NULL DEFAULT NULL COMMENT '软删除',
|
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;";
|
|
||||||
|
|
||||||
// 执行 SQL 语句创建表
|
|
||||||
$db->execute("DROP TABLE IF EXISTS `mpay_pay_account`;");
|
|
||||||
$db->execute($sql);
|
|
||||||
|
|
||||||
// 创建pay_channel表的 SQL 语句
|
|
||||||
$sql = "CREATE TABLE `mpay_pay_channel` (
|
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '渠道ID',
|
|
||||||
`account_id` int(11) NOT NULL DEFAULT '0' COMMENT '收款平台ID',
|
|
||||||
`channel` varchar(255) NOT NULL DEFAULT '' COMMENT '收款通道',
|
|
||||||
`type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '保存类型',
|
|
||||||
`qrcode` varchar(255) NOT NULL DEFAULT '' COMMENT '二维码',
|
|
||||||
`last_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '最近使用',
|
|
||||||
`state` tinyint(4) NOT NULL DEFAULT '1' COMMENT '启用',
|
|
||||||
`delete_time` timestamp NULL DEFAULT NULL COMMENT '软删除',
|
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;";
|
|
||||||
|
|
||||||
// 执行 SQL 语句创建表
|
|
||||||
$db->execute("DROP TABLE IF EXISTS `mpay_pay_channel`;");
|
|
||||||
$db->execute($sql);
|
|
||||||
|
|
||||||
// 创建user表的 SQL 语句
|
|
||||||
$sql = "CREATE TABLE `mpay_user` (
|
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`pid` int(11) NOT NULL DEFAULT '0' COMMENT '商户ID',
|
|
||||||
`secret_key` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '商户秘钥',
|
|
||||||
`nickname` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '用户昵称',
|
|
||||||
`username` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '账号',
|
|
||||||
`password` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '密码',
|
|
||||||
`state` tinyint(4) NOT NULL DEFAULT '1' COMMENT '启用状态 0:禁用 1:启用',
|
|
||||||
`role` tinyint(4) NOT NULL DEFAULT '0' COMMENT '用户角色 0:普通用户 1:管理员',
|
|
||||||
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
|
||||||
`delete_time` timestamp NULL DEFAULT NULL COMMENT '软删除',
|
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
|
||||||
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;";
|
|
||||||
|
|
||||||
// 执行 SQL 语句创建表
|
|
||||||
$db->execute("DROP TABLE IF EXISTS `mpay_user`;");
|
|
||||||
$db->execute($sql);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function initData($dbConfig)
|
/**
|
||||||
|
* 获取表创建的 SQL 语句
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
private function getTableCreationSqls(): array
|
||||||
{
|
{
|
||||||
// 连接数据库
|
return [
|
||||||
$db = Db::connect();
|
'mpay_order' => "CREATE TABLE `mpay_order` (
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`pid` int(11) NOT NULL DEFAULT 0,
|
||||||
|
`order_id` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`type` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`out_trade_no` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`notify_url` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`return_url` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`name` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`really_price` decimal(10, 2) NOT NULL DEFAULT 0.00,
|
||||||
|
`money` decimal(10, 2) NOT NULL DEFAULT 0.00,
|
||||||
|
`clientip` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`device` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`param` varchar(720) NOT NULL DEFAULT '',
|
||||||
|
`state` tinyint(4) NOT NULL DEFAULT 0,
|
||||||
|
`patt` tinyint(4) NOT NULL DEFAULT 0,
|
||||||
|
`create_time` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`close_time` datetime DEFAULT NULL,
|
||||||
|
`pay_time` datetime DEFAULT NULL,
|
||||||
|
`platform_order` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`aid` int(11) NOT NULL DEFAULT 0,
|
||||||
|
`cid` int(11) NOT NULL DEFAULT 0,
|
||||||
|
`delete_time` datetime DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
INDEX `idx_order_id` (`order_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;",
|
||||||
|
'mpay_pay_account' => "CREATE TABLE `mpay_pay_account` (
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`pid` int(11) NOT NULL DEFAULT 0,
|
||||||
|
`platform` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`account` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`password` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`state` tinyint(4) NOT NULL DEFAULT 1,
|
||||||
|
`pattern` tinyint(4) NOT NULL DEFAULT 1,
|
||||||
|
`params` text NOT NULL,
|
||||||
|
`delete_time` datetime DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;",
|
||||||
|
'mpay_pay_channel' => "CREATE TABLE `mpay_pay_channel` (
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`account_id` int(11) NOT NULL DEFAULT 0,
|
||||||
|
`channel` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`type` tinyint(4) NOT NULL DEFAULT 0,
|
||||||
|
`qrcode` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`last_time` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`state` tinyint(4) NOT NULL DEFAULT 1,
|
||||||
|
`delete_time` datetime DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;",
|
||||||
|
'mpay_user' => "CREATE TABLE `mpay_user` (
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`pid` int(11) NOT NULL DEFAULT 0,
|
||||||
|
`secret_key` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`nickname` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`username` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`password` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`state` tinyint(4) NOT NULL DEFAULT 1,
|
||||||
|
`role` tinyint(4) NOT NULL DEFAULT 0,
|
||||||
|
`create_time` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`delete_time` datetime DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化数据
|
||||||
|
* @param array $dbConfig
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
private function initData(array $dbConfig)
|
||||||
|
{
|
||||||
|
$db = $this->connectDatabase();
|
||||||
$info = [
|
$info = [
|
||||||
'secret_key' => md5(1000 . time() . mt_rand()),
|
'secret_key' => md5(1000 . time() . mt_rand()),
|
||||||
'nickname' => $dbConfig['nickname'],
|
'nickname' => $dbConfig['nickname'],
|
||||||
'username' => $dbConfig['username'],
|
'username' => $dbConfig['username'],
|
||||||
'password' => password_hash($dbConfig['password'], PASSWORD_DEFAULT),
|
'password' => password_hash($dbConfig['password'], PASSWORD_DEFAULT),
|
||||||
|
'create_time' => date('Y-m-d H:i:s'),
|
||||||
];
|
];
|
||||||
// 初始化数据的 SQL 语句
|
|
||||||
$sql = "INSERT INTO `mpay_user` (`id`, `pid`, `secret_key`, `nickname`, `username`, `password`, `state`, `role`) VALUES (1, 1000, :secret_key, :nickname, :username, :password, 1, 1);";
|
|
||||||
|
|
||||||
// 执行 SQL 语句插入初始数据
|
$sql = "INSERT INTO `mpay_user` (`id`, `pid`, `secret_key`, `nickname`, `username`, `password`, `state`, `role`, `create_time`) VALUES (1, 1000, :secret_key, :nickname, :username, :password, 1, 1, :create_time);";
|
||||||
$is_succ = $db->execute($sql, $info);
|
|
||||||
if (!$is_succ) {
|
try {
|
||||||
return false;
|
$db->execute($sql, $info);
|
||||||
|
Log::info("mpay_user 表数据初始化成功");
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
throw new \Exception("初始化 mpay_user 表数据失败: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查是否已安装
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
private function checkLock()
|
private function checkLock()
|
||||||
{
|
{
|
||||||
$path = runtime_path() . 'install.lock';
|
$path = runtime_path() . self::INSTALL_LOCK_FILE;
|
||||||
return file_exists($path);
|
return file_exists($path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置安装锁
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
private function setLock()
|
private function setLock()
|
||||||
{
|
{
|
||||||
$path = runtime_path() . 'install.lock';
|
$path = runtime_path() . self::INSTALL_LOCK_FILE;
|
||||||
file_put_contents($path, time());
|
if (file_put_contents($path, time()) === false) {
|
||||||
|
throw new \Exception("无法写入安装锁文件");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新数据库结构
|
||||||
|
* @return \think\response\Json
|
||||||
|
*/
|
||||||
|
public function update()
|
||||||
|
{
|
||||||
|
if ($this->checkLock()) {
|
||||||
|
return json(backMsg(1, '已经安装'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$db = $this->connectDatabase();
|
||||||
|
try {
|
||||||
|
$result = $db->query("SHOW COLUMNS FROM `mpay_pay_account` WHERE Field = 'params'");
|
||||||
|
if ($result && $result[0]['Type'] != 'text') {
|
||||||
|
$sql = "ALTER TABLE `mpay_pay_account` MODIFY COLUMN `params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '自定义查询' AFTER `pattern`;";
|
||||||
|
$is_succ = $db->execute($sql);
|
||||||
|
if (!$is_succ) {
|
||||||
|
throw new \Exception("修改 mpay_pay_account 表 params 列类型失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return json(backMsg(0, '数据库结构检查并更新完成'));
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Log::error("更新数据库结构失败: " . $e->getMessage());
|
||||||
|
return json(backMsg(1, '数据库结构更新失败'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
// 请求外部资源
|
// 请求外部资源
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
// 请求外部资源
|
// 请求外部资源
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ class PayManageController extends BaseController
|
|||||||
if ($check) {
|
if ($check) {
|
||||||
return json(backMsg(1, '编号已存在'));
|
return json(backMsg(1, '编号已存在'));
|
||||||
}
|
}
|
||||||
|
$info['last_time'] = date('Y-m-d H:i:s');
|
||||||
$res = PayChannel::create($info);
|
$res = PayChannel::create($info);
|
||||||
if ($res) {
|
if ($res) {
|
||||||
return json(backMsg(0, '添加成功'));
|
return json(backMsg(0, '添加成功'));
|
||||||
|
|||||||
@@ -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');
|
||||||
|
|||||||
BIN
assets/20250217_103606_wxmonitor_v1.2.zip
Normal file
BIN
assets/20250217_103606_wxmonitor_v1.2.zip
Normal file
Binary file not shown.
@@ -12,23 +12,11 @@ return array (
|
|||||||
'price' => NULL,
|
'price' => NULL,
|
||||||
'describe' => '支持微信个人收款码、赞赏码、经营码、商家码收款,监听回调',
|
'describe' => '支持微信个人收款码、赞赏码、经营码、商家码收款,监听回调',
|
||||||
'website' => 'https://weixin.qq.com',
|
'website' => 'https://weixin.qq.com',
|
||||||
'helplink' => '',
|
'helplink' => 'https://f0bmwzqjtq2.feishu.cn/docx/JBshdZWokoWzLmxSKQWcSd4Jncg',
|
||||||
'version' => '1.0',
|
'version' => '1.0',
|
||||||
'state' => 1,
|
'state' => 1,
|
||||||
),
|
),
|
||||||
1 =>
|
1 =>
|
||||||
array (
|
|
||||||
'platform' => 'sqbpay',
|
|
||||||
'name' => '收钱吧',
|
|
||||||
'class_name' => 'ShouQianBa',
|
|
||||||
'price' => NULL,
|
|
||||||
'describe' => '主流移动支付全能收 信用卡,花呗都能用,生意帮手收钱吧,移动收款就用它!',
|
|
||||||
'website' => 'https://www.shouqianba.com',
|
|
||||||
'helplink' => '',
|
|
||||||
'version' => '1.0',
|
|
||||||
'state' => 1,
|
|
||||||
),
|
|
||||||
2 =>
|
|
||||||
array (
|
array (
|
||||||
'platform' => 'alipay',
|
'platform' => 'alipay',
|
||||||
'name' => '支付宝',
|
'name' => '支付宝',
|
||||||
@@ -36,7 +24,19 @@ return array (
|
|||||||
'price' => NULL,
|
'price' => NULL,
|
||||||
'describe' => '支持支付宝个人收款码、经营码收款,监听回调',
|
'describe' => '支持支付宝个人收款码、经营码收款,监听回调',
|
||||||
'website' => 'https://www.alipay.com',
|
'website' => 'https://www.alipay.com',
|
||||||
'helplink' => '',
|
'helplink' => 'https://f0bmwzqjtq2.feishu.cn/docx/GfltdDrjxoYXwexhtX8ckDCBn9f',
|
||||||
|
'version' => '1.0',
|
||||||
|
'state' => 1,
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
'platform' => 'sqbpay',
|
||||||
|
'name' => '收钱吧',
|
||||||
|
'class_name' => 'ShouQianBa',
|
||||||
|
'price' => NULL,
|
||||||
|
'describe' => '主流移动支付全能收 信用卡,花呗都能用,生意帮手收钱吧,移动收款就用它!',
|
||||||
|
'website' => 'https://www.shouqianba.com',
|
||||||
|
'helplink' => 'https://f0bmwzqjtq2.feishu.cn/docx/WwN7dRqmuoozlIxgiuFclZhCnte',
|
||||||
'version' => '1.0',
|
'version' => '1.0',
|
||||||
'state' => 1,
|
'state' => 1,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -63,10 +63,12 @@ class Plugin
|
|||||||
public static function getNotifyMessage(): array
|
public static function getNotifyMessage(): array
|
||||||
{
|
{
|
||||||
$message = cache('message');
|
$message = cache('message');
|
||||||
if ($message) return json_decode($message, true);
|
if ($message) return $message;
|
||||||
$message = self::getHttpResponse(self::$siteUrl . '/MpayApi', ['action' => 'message']);
|
$message = self::getHttpResponse(self::$siteUrl . '/MpayApi', ['action' => 'message']);
|
||||||
cache('message', $message, 36000);
|
$info = json_decode($message, true);
|
||||||
return json_decode($message, true);
|
if($info === null) return [];
|
||||||
|
if ($info['code'] === 0) cache('message', $info['data'], 36000);
|
||||||
|
return $info['data'];
|
||||||
}
|
}
|
||||||
// 安装插件
|
// 安装插件
|
||||||
public static function installPlugin($platform): array
|
public static function installPlugin($platform): array
|
||||||
|
|||||||
Binary file not shown.
@@ -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">
|
||||||
|
|||||||
1572
view/index/doc.html
1572
view/index/doc.html
File diff suppressed because it is too large
Load Diff
@@ -134,6 +134,12 @@
|
|||||||
</span><span>元</span></div>
|
</span><span>元</span></div>
|
||||||
<div class="qrcode"><img id="qrcode" src="/static/img/loading.gif">
|
<div class="qrcode"><img id="qrcode" src="/static/img/loading.gif">
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 添加跳转按钮 -->
|
||||||
|
<div style="margin: 16px auto;display: none;">
|
||||||
|
<button id="openApp" class="layui-btn layui-btn-normal">
|
||||||
|
打开支付应用
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<div class="msg">
|
<div class="msg">
|
||||||
<p>请付款 <span class="note">
|
<p>请付款 <span class="note">
|
||||||
<?php echo htmlentities($really_price); ?>
|
<?php echo htmlentities($really_price); ?>
|
||||||
@@ -180,7 +186,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); ?>';
|
||||||
@@ -284,6 +290,29 @@
|
|||||||
} else if (payType === 'alipay' && environment === 'wxphone') {
|
} else if (payType === 'alipay' && environment === 'wxphone') {
|
||||||
layer.alert('请使用支付宝打开此页面');
|
layer.alert('请使用支付宝打开此页面');
|
||||||
}
|
}
|
||||||
|
// 添加按钮控制逻辑
|
||||||
|
const openAppBtn = document.getElementById('openApp');
|
||||||
|
if (environment === 'phone') {
|
||||||
|
openAppBtn.parentNode.style.display = 'block';
|
||||||
|
if (payType === 'wxpay') {
|
||||||
|
openAppBtn.innerText = '截图并打开微信';
|
||||||
|
openAppBtn.className = 'layui-btn layui-btn-green';
|
||||||
|
openAppBtn.onclick = function () {
|
||||||
|
window.location.href = 'weixin://';
|
||||||
|
};
|
||||||
|
} else if (payType === 'alipay') {
|
||||||
|
openAppBtn.innerText = '打开支付宝付款';
|
||||||
|
openAppBtn.className = 'layui-btn layui-btn-normal';
|
||||||
|
openAppBtn.onclick = function () {
|
||||||
|
if (codeType == 0) {
|
||||||
|
window.location.href = 'alipays://platformapi/startapp?appId=20000067&&url=' + payCode;
|
||||||
|
} else {
|
||||||
|
const currentUrl = window.location.href;
|
||||||
|
window.location.href = 'alipays://platformapi/startapp?appId=20000067&&url=' + currentUrl;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
// 生成二维码
|
// 生成二维码
|
||||||
async function getQrcode(text, QR) {
|
async function getQrcode(text, QR) {
|
||||||
const qrcodeUrl = await new Promise((resolve) => {
|
const qrcodeUrl = await new Promise((resolve) => {
|
||||||
|
|||||||
@@ -19,6 +19,23 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.infomsg {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-left: 10px;
|
||||||
|
width: calc(100% - 20px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.infomsg div:first-child {
|
||||||
|
width: 100%;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infomsg div:last-child {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -55,22 +72,26 @@
|
|||||||
<div class="layui-form-item" pane>
|
<div class="layui-form-item" pane>
|
||||||
<label class="layui-form-label">API 接口</label>
|
<label class="layui-form-label">API 接口</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<div class="layui-form-mid" style="margin-left: 10px;color: #5f5f5f;float: none;">
|
<div class="layui-form-mid infomsg">
|
||||||
<?php echo $url ?>
|
<div>
|
||||||
<a href="javascript:;" lay-on="copyinfo" data-info="<?php echo $url ?>"
|
<?php echo $url ?>
|
||||||
style="float: right;" title="复制"><span
|
</div>
|
||||||
class="icon pear-icon pear-icon-survey"></span></a>
|
<div><a href="javascript:;" lay-on="copyinfo" data-info="<?php echo $url ?>"
|
||||||
|
title="复制"><span class="icon pear-icon pear-icon-survey"></span></a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item" pane>
|
<div class="layui-form-item" pane>
|
||||||
<label class="layui-form-label">商户 PID</label>
|
<label class="layui-form-label">商户 PID</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<div class="layui-form-mid" style="margin-left: 10px;color: #5f5f5f;float: none;">
|
<div class="layui-form-mid infomsg">
|
||||||
<?php echo $pid ?>
|
<div>
|
||||||
<a href="javascript:;" lay-on="copyinfo" data-info="<?php echo $pid ?>"
|
<?php echo $pid ?>
|
||||||
style="float: right;" title="复制"><span
|
</div>
|
||||||
class="icon pear-icon pear-icon-survey"></span></a>
|
<div><a href="javascript:;" lay-on="copyinfo" data-info="<?php echo $pid ?>"
|
||||||
|
title="复制"><span class="icon pear-icon pear-icon-survey"></span></a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -78,12 +99,15 @@
|
|||||||
<label class="layui-form-label">商户密钥 <a href="javascript:;" lay-on="resetKey"
|
<label class="layui-form-label">商户密钥 <a href="javascript:;" lay-on="resetKey"
|
||||||
title="重置密钥"><span class="icon pear-icon pear-icon-refresh"></span></a></label>
|
title="重置密钥"><span class="icon pear-icon pear-icon-refresh"></span></a></label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<div class="layui-form-mid layui-elip"
|
<div class="layui-form-mid infomsg">
|
||||||
style="margin-left: 10px;color: #5f5f5f;float: none;">
|
<div>
|
||||||
<?php echo $secret_key ?>
|
<?php echo $secret_key ?>
|
||||||
<a href="javascript:;" lay-on="copyinfo" data-info="<?php echo $secret_key ?>"
|
</div>
|
||||||
style="float: right;" title="复制"><span
|
<div>
|
||||||
class="icon pear-icon pear-icon-survey"></span></a>
|
<a href="javascript:;" lay-on="copyinfo"
|
||||||
|
data-info="<?php echo $secret_key ?>" title="复制"><span
|
||||||
|
class="icon pear-icon pear-icon-survey"></span></a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -98,12 +122,14 @@
|
|||||||
<div class="layui-form-item" pane>
|
<div class="layui-form-item" pane>
|
||||||
<label class="layui-form-label">订单监控</label>
|
<label class="layui-form-label">订单监控</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<div class="layui-form-mid layui-elip"
|
<div class="layui-form-mid infomsg">
|
||||||
style="margin-left: 10px;color: #5f5f5f;float: none;">
|
<div>
|
||||||
<?php echo $orderurl ?>
|
<?php echo $orderurl ?>
|
||||||
<a href="javascript:;" lay-on="copyinfo" data-info="<?php echo $orderurl ?>"
|
</div>
|
||||||
style="float: right;" title="复制"><span
|
<div><a href="javascript:;" lay-on="copyinfo"
|
||||||
class="icon pear-icon pear-icon-survey"></span></a>
|
data-info="<?php echo $orderurl ?>" title="复制"><span
|
||||||
|
class="icon pear-icon pear-icon-survey"></span></a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -123,94 +149,103 @@
|
|||||||
<div class="layui-form-item" pane>
|
<div class="layui-form-item" pane>
|
||||||
<label class="layui-form-label">Webhook</label>
|
<label class="layui-form-label">Webhook</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<div class="layui-form-mid layui-elip"
|
<div class="layui-form-mid infomsg">
|
||||||
style="margin-left: 10px;color: #5f5f5f;float: none;">
|
<div>
|
||||||
<?php echo $url . 'mpayNotify' ?>
|
<?php echo $url . 'mpayNotify' ?>
|
||||||
<a href="javascript:;" lay-on="copyinfo"
|
</div>
|
||||||
data-info="<?php echo $url . 'mpayNotify' ?>" style="float: right;"
|
<div><a href="javascript:;" lay-on="copyinfo"
|
||||||
title="复制"><span class="icon pear-icon pear-icon-survey"></span></a>
|
data-info="<?php echo $url . 'mpayNotify' ?>" title="复制"><span
|
||||||
|
class="icon pear-icon pear-icon-survey"></span></a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item" pane>
|
<div class="layui-form-item" pane>
|
||||||
<label class="layui-form-label">消息模版</label>
|
<label class="layui-form-label">消息模版</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<div class="layui-form-mid layui-elip"
|
<div class="layui-form-mid infomsg">
|
||||||
style="margin-left: 10px;color: #5f5f5f;float: none;">
|
<div>{"action": "mpay","data": "[msg]","time":"[timestamp]","sign":
|
||||||
{"action": "mpay","data": "[msg]","time":"[timestamp]","sign": "[sign]"}
|
"[sign]"}
|
||||||
<a href="javascript:;" lay-on="copyinfo"
|
</div>
|
||||||
data-info='{"action": "mpay","data": "[msg]","time":"[timestamp]","sign": "[sign]"}'
|
<div><a href="javascript:;" lay-on="copyinfo"
|
||||||
style="float: right;" title="复制"><span
|
data-info='{"action": "mpay","data": "[msg]","time":"[timestamp]","sign": "[sign]"}'
|
||||||
class="icon pear-icon pear-icon-survey"></span></a>
|
title="复制"><span
|
||||||
|
class="icon pear-icon pear-icon-survey"></span></a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item" pane>
|
<div class="layui-form-item" pane>
|
||||||
<label class="layui-form-label">Secret</label>
|
<label class="layui-form-label">Secret</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<div class="layui-form-mid layui-elip"
|
<div class="layui-form-mid infomsg">
|
||||||
style="margin-left: 10px;color: #5f5f5f;float: none;">
|
<div>
|
||||||
<?php echo $secret_key ?>
|
<?php echo $secret_key ?>
|
||||||
<a href="javascript:;" lay-on="copyinfo"
|
</div>
|
||||||
data-info="<?php echo $secret_key ?>" style="float: right;"
|
<div><a href="javascript:;" lay-on="copyinfo"
|
||||||
title="复制"><span class="icon pear-icon pear-icon-survey"></span></a>
|
data-info="<?php echo $secret_key ?>" title="复制"><span
|
||||||
|
class="icon pear-icon pear-icon-survey"></span></a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item" pane>
|
<div class="layui-form-item" pane>
|
||||||
<label class="layui-form-label">成功关键字</label>
|
<label class="layui-form-label">成功关键字</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<div class="layui-form-mid layui-elip"
|
<div class="layui-form-mid infomsg">
|
||||||
style="margin-left: 10px;color: #5f5f5f;float: none;">
|
<div>200</div>
|
||||||
200
|
<div><a href="javascript:;" lay-on="copyinfo" data-info="200"
|
||||||
<a href="javascript:;" lay-on="copyinfo" data-info="200"
|
title="复制"><span
|
||||||
style="float: right;" title="复制"><span
|
class="icon pear-icon pear-icon-survey"></span></a>
|
||||||
class="icon pear-icon pear-icon-survey"></span></a>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
|
||||||
<fieldset class="layui-elem-field">
|
|
||||||
<legend style="font-size: 14px;">应用转发规则·多重匹配</legend>
|
|
||||||
<div class="layui-field-box">
|
|
||||||
<div class="layui-form layui-form-pane">
|
|
||||||
<div class="layui-form-item" pane>
|
|
||||||
<label class="layui-form-label">微信支付</label>
|
|
||||||
<div class="layui-input-block">
|
|
||||||
<div class="layui-form-mid layui-elip"
|
|
||||||
style="margin-left: 10px;color: #5f5f5f;float: none;">
|
|
||||||
<?php echo '并且 是 APP包名 相等 com.tencent.mm<br />并且 是 通知标题 相等 微信支付<br />[空格]或者 是 通知标题 相等 微信收款助手<br />[空格]或者 是 通知标题 相等 微信收款商业版' ?>
|
|
||||||
<a href="javascript:;" lay-on="copyinfo"
|
|
||||||
data-info='<?php echo "并且 是 APP包名 相等 com.tencent.mm\n并且 是 通知标题 相等 微信支付\n[空格]或者 是 通知标题 相等 微信收款助手\n[空格]或者 是 通知标题 相等 微信收款商业版" ?>'
|
|
||||||
style="float: right;" title="复制"><span
|
|
||||||
class="icon pear-icon pear-icon-survey"></span></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="layui-form-item" pane>
|
|
||||||
<label class="layui-form-label">支付宝</label>
|
|
||||||
<div class="layui-input-block">
|
|
||||||
<div class="layui-form-mid layui-elip"
|
|
||||||
style="margin-left: 10px;color: #5f5f5f;float: none;">
|
|
||||||
<?php echo '并且 是 APP包名 相等 com.eg.android.AlipayGphone<br />并且 是 通知标题 包含 元<br />[空格]或者 是 通知内容 包含 元' ?>
|
|
||||||
<a href="javascript:;" lay-on="copyinfo"
|
|
||||||
data-info='<?php echo "并且 是 APP包名 相等 com.eg.android.AlipayGphone\n并且 是 通知标题 包含 元\n[空格]或者 是 通知内容 包含 元" ?>'
|
|
||||||
style="float: right;" title="复制"><span
|
|
||||||
class="icon pear-icon pear-icon-survey"></span></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset class="layui-elem-field">
|
||||||
|
<legend style="font-size: 14px;">应用转发规则·多重匹配</legend>
|
||||||
|
<div class="layui-field-box">
|
||||||
|
<div class="layui-form layui-form-pane">
|
||||||
|
<div class="layui-form-item" pane>
|
||||||
|
<label class="layui-form-label">微信支付</label>
|
||||||
|
<div class="layui-input-block">
|
||||||
|
<div class="layui-form-mid infomsg">
|
||||||
|
<div>
|
||||||
|
<?php echo '并且 是 APP包名 相等 com.tencent.mm<br />并且 是 通知标题 相等 微信支付<br />[空格]或者 是 通知标题 相等 微信收款助手<br />[空格]或者 是 通知标题 相等 微信收款商业版' ?>
|
||||||
|
</div>
|
||||||
|
<div><a href="javascript:;" lay-on="copyinfo"
|
||||||
|
data-info='<?php echo "并且 是 APP包名 相等 com.tencent.mm\n并且 是 通知标题 相等 微信支付\n[空格]或者 是 通知标题 相等 微信收款助手\n[空格]或者 是 通知标题 相等 微信收款商业版" ?>'
|
||||||
|
title="复制"><span class="icon pear-icon pear-icon-survey"></span></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-item" pane>
|
||||||
|
<label class="layui-form-label">支付宝</label>
|
||||||
|
<div class="layui-input-block">
|
||||||
|
<div class="layui-form-mid infomsg">
|
||||||
|
<div>
|
||||||
|
<?php echo '并且 是 APP包名 相等 com.eg.android.AlipayGphone<br />并且 是 通知标题 包含 元<br />[空格]或者 是 通知内容 包含 元' ?>
|
||||||
|
</div>
|
||||||
|
<div><a href="javascript:;" lay-on="copyinfo"
|
||||||
|
data-info='<?php echo "并且 是 APP包名 相等 com.eg.android.AlipayGphone\n并且 是 通知标题 包含 元\n[空格]或者 是 通知内容 包含 元" ?>'
|
||||||
|
title="复制"><span class="icon pear-icon pear-icon-survey"></span></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<script src="/component/layui/layui.js"></script>
|
<script src="/component/layui/layui.js"></script>
|
||||||
<script src="/component/pear/pear.js"></script>
|
<script src="/component/pear/pear.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
Reference in New Issue
Block a user