mirror of
https://gitee.com/technical-laohu/mpay.git
synced 2025-09-18 17:56:38 +08:00
文档更新
This commit is contained in:
parent
40a287ad41
commit
8f1d6ce013
13
README.md
13
README.md
@ -38,20 +38,27 @@
|
|||||||
优点是审核不严,处理比较灵活,适合个人,技术支持比较好,注册可使用(有些需要注册费)
|
优点是审核不严,处理比较灵活,适合个人,技术支持比较好,注册可使用(有些需要注册费)
|
||||||
缺点就是平台容易卷款跑路,也没有什么有效监管,钱收不回来就亏大了(这也是最大的问题)
|
缺点就是平台容易卷款跑路,也没有什么有效监管,钱收不回来就亏大了(这也是最大的问题)
|
||||||
|
|
||||||
### 源支付
|
### 源支付/V免签
|
||||||
|
|
||||||
源支付也是一套收款程序,有个人版和商户版,市面上能搜到的大部分都是商户版,可以入驻,使用自己的个人微信支付宝二维码收款。
|
源支付也是一套收款程序,有个人版和商户版,市面上能搜到的大部分都是商户版,可以入驻,使用自己的个人微信支付宝二维码收款。
|
||||||
源支付程序的设计思路主要是通过在手机或电脑上安装消息监听软件,用来监听获取微信和支付宝的收款到账通知来实现的支付成功回调的。**方法很实用,本程序也添加了该功能插件,免费**。
|
|
||||||
|
V免签是一款开源免费适用于个人收款使用的收款程序,原理同源支付类似。
|
||||||
|
程序的设计思路主要是通过在手机或电脑上安装消息监听软件,用来监听获取微信和支付宝的收款到账通知来实现的支付成功回调的。**方法很实用,本程序也添加了该功能插件,免费**。
|
||||||
只是这种思路,有一些小问题:
|
只是这种思路,有一些小问题:
|
||||||
|
|
||||||
* 平台容易因为资质问题导致关站;
|
* 平台容易因为资质问题导致关站;
|
||||||
* 收取的手续费价格偏高;
|
* 收取的手续费价格偏高;
|
||||||
* 个人码在微信H5环境无法长按识别付款,只能通过PC端,相机扫码付款。
|
* 个人码在微信H5环境无法长按识别付款,只能通过PC端,相机扫码付款。
|
||||||
|
* 挂机监听容易掉线,导致收款通知无法回调
|
||||||
|
|
||||||
### 🚀️ 码支付(mpay)
|
### 🚀️ 码支付(mpay)
|
||||||
|
|
||||||
**本程序暂只提供个人版,开源免费使用。**
|
**本程序暂只提供个人版,开源免费使用。**
|
||||||
码支付是在源支付的设计思路基础上进行的改进,利用第四方**聚合收款码**来进行收款,保证收款稳定和便捷。聚合收款码个人可以申请,不需求相关资质,不用申请API接口,收银服务平台众多且实力雄厚(如拉卡拉、收钱吧等),不怕跑路。
|
|
||||||
|
码支付是在源支付的设计思路基础上进行的改进,利用第四方**聚合收款码**来进行收款,保证收款稳定和便捷不掉线。
|
||||||
|
|
||||||
|
聚合收款码个人可以申请,不需求相关资质,不用申请API接口,收银服务平台众多且实力雄厚(如拉卡拉、收钱吧等),不怕跑路。
|
||||||
|
|
||||||
特点如下:
|
特点如下:
|
||||||
|
|
||||||
* 免监听,不需要手机或电脑挂机监听消息,即可实现支付回调,只需要设置一个定时任务就行
|
* 免监听,不需要手机或电脑挂机监听消息,即可实现支付回调,只需要设置一个定时任务就行
|
||||||
|
@ -1,58 +1,30 @@
|
|||||||
// 插件配置
|
// 登陆配置
|
||||||
const plugins = [
|
const logins = [
|
||||||
|
{
|
||||||
|
name: '拉卡拉',
|
||||||
|
host: 'm2.lakala.com',
|
||||||
|
method: 'POST',
|
||||||
|
orderQuery: '/m/lamsmerdash/account/pwdLogin',
|
||||||
|
accPath: 'account',
|
||||||
|
pswPath: 'pwd',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: '收钱吧',
|
name: '收钱吧',
|
||||||
host: 'web-platforms-msp.shouqianba.com',
|
host: 'web-platforms-msp.shouqianba.com',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
orderQuery: '/api/transaction/findTransactions',
|
orderQuery: '/api/login/ucUser/login',
|
||||||
channelKey: 'terminal_device_fingerprint',
|
accPath: 'username',
|
||||||
moneyKey: 'original_amount',
|
pswPath: 'password',
|
||||||
listPath: 'data.records'
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
// 登陆配置
|
|
||||||
const logins = [
|
|
||||||
{
|
|
||||||
name: '新商城',
|
|
||||||
host: 'localhost',
|
|
||||||
method: 'GET',
|
|
||||||
orderQuery: '/api/Order/getOrders',
|
|
||||||
accPath: 'order_id',
|
|
||||||
pswPath: 'money',
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
// 提取订单信息
|
|
||||||
function extractOrderInfo(response, plugins) {
|
|
||||||
plugins.forEach((plugin) => {
|
|
||||||
const urlObj = new URL(response.url);
|
|
||||||
if (plugin.host === urlObj.hostname
|
|
||||||
&& plugin.orderQuery === urlObj.pathname
|
|
||||||
&& plugin.method === response.method) {
|
|
||||||
const jsonDatas = JSON.parse(response.response);
|
|
||||||
const orderDatas = eval(`jsonDatas.${plugin.listPath}`);
|
|
||||||
let lists = [];
|
|
||||||
orderDatas.forEach((orderData) => {
|
|
||||||
const data = {
|
|
||||||
'终端编号': orderData[plugin.channelKey],
|
|
||||||
'订单金额': orderData[plugin.moneyKey]
|
|
||||||
};
|
|
||||||
lists.push(data);
|
|
||||||
})
|
|
||||||
console.log(plugin.name);
|
|
||||||
console.table(lists);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 提取登陆信息
|
// 提取登陆信息
|
||||||
function extractLoginInfo(request, logins) {
|
function extractLoginInfo(request, logins) {
|
||||||
logins.forEach((login) => {
|
logins.forEach((login) => {
|
||||||
const urlObj = new URL(request.url);
|
const urlObj = isHttp(request.url, login.host);
|
||||||
if (login.host === urlObj.hostname
|
if (login.host.toLowerCase() === urlObj.hostname.toLowerCase()
|
||||||
&& login.orderQuery === urlObj.pathname
|
&& login.orderQuery.toLowerCase() === urlObj.pathname.toLowerCase()
|
||||||
&& login.method === request.method) {
|
&& login.method.toLowerCase() === request.method.toLowerCase()) {
|
||||||
const jsonData = JSON.parse(request.request);
|
const jsonData = JSON.parse(request.request);
|
||||||
const acc = eval(`jsonData.${login.accPath}`);
|
const acc = eval(`jsonData.${login.accPath}`);
|
||||||
const psw = eval(`jsonData.${login.pswPath}`);
|
const psw = eval(`jsonData.${login.pswPath}`);
|
||||||
@ -60,53 +32,51 @@ function extractLoginInfo(request, logins) {
|
|||||||
'账号': acc,
|
'账号': acc,
|
||||||
'密码': psw
|
'密码': psw
|
||||||
};
|
};
|
||||||
console.log(login.name);
|
console.log('-----' + login.name + '-----');
|
||||||
console.table(data);
|
console.table(data);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检查网址是否为http或https开头的字符串
|
||||||
|
function isHttp(url, host) {
|
||||||
|
if (url.startsWith('http') || url.startsWith('https')) {
|
||||||
|
return new URL(url);
|
||||||
|
} else {
|
||||||
|
url = 'https://' + host + url;
|
||||||
|
return new URL(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// XHR 重写
|
// XHR 重写
|
||||||
var oldOpen = XMLHttpRequest.prototype.open;
|
var oldOpen = XMLHttpRequest.prototype.open;
|
||||||
var oldSend = XMLHttpRequest.prototype.send;
|
var oldSend = XMLHttpRequest.prototype.send;
|
||||||
XMLHttpRequest.prototype.open = function (method, url) {
|
XMLHttpRequest.prototype.open = function (method, url) {
|
||||||
this._url = url;
|
this._url = url;
|
||||||
this._method = method;
|
this._method = method;
|
||||||
const res = {
|
|
||||||
url: this.responseURL,
|
|
||||||
method: this._method,
|
|
||||||
response: this._body
|
|
||||||
}
|
|
||||||
extractLoginInfo(res, logins);
|
|
||||||
return oldOpen.apply(this, arguments);
|
return oldOpen.apply(this, arguments);
|
||||||
};
|
};
|
||||||
XMLHttpRequest.prototype.send = function (body) {
|
XMLHttpRequest.prototype.send = function (body) {
|
||||||
this._body = body;
|
this._body = body;
|
||||||
this.addEventListener('load', function () {
|
|
||||||
const res = {
|
const res = {
|
||||||
url: this.responseURL,
|
url: this._url,
|
||||||
method: this._method,
|
method: this._method,
|
||||||
response: this.responseText
|
request: this._body
|
||||||
}
|
}
|
||||||
console.log(res);
|
extractLoginInfo(res, logins);
|
||||||
|
|
||||||
extractOrderInfo(res, plugins);
|
|
||||||
});
|
|
||||||
return oldSend.apply(this, arguments);
|
return oldSend.apply(this, arguments);
|
||||||
};
|
};
|
||||||
|
|
||||||
// fetch 重写
|
// fetch 重写
|
||||||
window.au_fetch = window.fetch;
|
window.au_fetch = window.fetch;
|
||||||
window.fetch = function (url, options) {
|
window.fetch = function (url, options) {
|
||||||
// console.log('Fetch URL:', url);
|
|
||||||
// console.log('Fetch Options:', options);
|
|
||||||
return window.au_fetch.apply(window, [url, options]).then((response) => {
|
|
||||||
const res = {
|
const res = {
|
||||||
url: url,
|
url: url,
|
||||||
method: options.method,
|
method: options.method,
|
||||||
response: response.text()
|
request: options.body
|
||||||
}
|
}
|
||||||
extractOrderInfo(res, plugins);
|
extractLoginInfo(res, logins);
|
||||||
|
return window.au_fetch.apply(window, [url, options]).then((response) => {
|
||||||
return response;
|
return response;
|
||||||
});
|
});
|
||||||
};
|
};
|
@ -483,7 +483,7 @@
|
|||||||
// 点击事件
|
// 点击事件
|
||||||
util.on({
|
util.on({
|
||||||
'load': () => {
|
'load': () => {
|
||||||
util.openWin({ url: 'https://gitee.com/technical-laohu/mpay' });
|
util.openWin({ url: 'https://gitee.com/technical-laohu/mpay/releases' });
|
||||||
},
|
},
|
||||||
'doc': () => {
|
'doc': () => {
|
||||||
util.openWin({ url: 'https://f0bmwzqjtq2.feishu.cn/docx/HBVrdrsACo36bzxUCSPcjOBNnyb?from=from_copylink' });
|
util.openWin({ url: 'https://f0bmwzqjtq2.feishu.cn/docx/HBVrdrsACo36bzxUCSPcjOBNnyb?from=from_copylink' });
|
||||||
|
Loading…
Reference in New Issue
Block a user