mirror of
https://gitee.com/technical-laohu/mpay.git
synced 2025-09-17 17:26:40 +08:00
文档更新
This commit is contained in:
parent
40a287ad41
commit
8f1d6ce013
15
README.md
15
README.md
@ -38,20 +38,27 @@
|
||||
优点是审核不严,处理比较灵活,适合个人,技术支持比较好,注册可使用(有些需要注册费)
|
||||
缺点就是平台容易卷款跑路,也没有什么有效监管,钱收不回来就亏大了(这也是最大的问题)
|
||||
|
||||
### 源支付
|
||||
### 源支付/V免签
|
||||
|
||||
源支付也是一套收款程序,有个人版和商户版,市面上能搜到的大部分都是商户版,可以入驻,使用自己的个人微信支付宝二维码收款。
|
||||
源支付程序的设计思路主要是通过在手机或电脑上安装消息监听软件,用来监听获取微信和支付宝的收款到账通知来实现的支付成功回调的。**方法很实用,本程序也添加了该功能插件,免费**。
|
||||
|
||||
V免签是一款开源免费适用于个人收款使用的收款程序,原理同源支付类似。
|
||||
程序的设计思路主要是通过在手机或电脑上安装消息监听软件,用来监听获取微信和支付宝的收款到账通知来实现的支付成功回调的。**方法很实用,本程序也添加了该功能插件,免费**。
|
||||
只是这种思路,有一些小问题:
|
||||
|
||||
* 平台容易因为资质问题导致关站;
|
||||
* 收取的手续费价格偏高;
|
||||
* 个人码在微信H5环境无法长按识别付款,只能通过PC端,相机扫码付款。
|
||||
* 挂机监听容易掉线,导致收款通知无法回调
|
||||
|
||||
### 🚀️ 码支付(mpay)
|
||||
|
||||
**本程序暂只提供个人版,开源免费使用。**
|
||||
码支付是在源支付的设计思路基础上进行的改进,利用第四方**聚合收款码**来进行收款,保证收款稳定和便捷。聚合收款码个人可以申请,不需求相关资质,不用申请API接口,收银服务平台众多且实力雄厚(如拉卡拉、收钱吧等),不怕跑路。
|
||||
|
||||
码支付是在源支付的设计思路基础上进行的改进,利用第四方**聚合收款码**来进行收款,保证收款稳定和便捷不掉线。
|
||||
|
||||
聚合收款码个人可以申请,不需求相关资质,不用申请API接口,收银服务平台众多且实力雄厚(如拉卡拉、收钱吧等),不怕跑路。
|
||||
|
||||
特点如下:
|
||||
|
||||
* 免监听,不需要手机或电脑挂机监听消息,即可实现支付回调,只需要设置一个定时任务就行
|
||||
@ -223,7 +230,7 @@
|
||||
|
||||
**终端编号**需要填写当前收款码在收银服务商系统内的编码,有的可以直接在收款二维码解析的**链接里找到**,有的需要**登陆商户管理中心**,去订单详情里查询才能知道
|
||||
|
||||
🚀️ 具体各个平台的终端编号如何获取,可以去**程序后端控制台主页**的`项目文档`查看🚀️
|
||||
🚀️ 具体各个平台的终端编号如何获取,可以去**程序后端控制台主页**的`项目文档`查看🚀️
|
||||
|
||||

|
||||
|
||||
|
@ -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: '收钱吧',
|
||||
host: 'web-platforms-msp.shouqianba.com',
|
||||
method: 'POST',
|
||||
orderQuery: '/api/transaction/findTransactions',
|
||||
channelKey: 'terminal_device_fingerprint',
|
||||
moneyKey: 'original_amount',
|
||||
listPath: 'data.records'
|
||||
orderQuery: '/api/login/ucUser/login',
|
||||
accPath: 'username',
|
||||
pswPath: 'password',
|
||||
}
|
||||
];
|
||||
|
||||
// 登陆配置
|
||||
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) {
|
||||
logins.forEach((login) => {
|
||||
const urlObj = new URL(request.url);
|
||||
if (login.host === urlObj.hostname
|
||||
&& login.orderQuery === urlObj.pathname
|
||||
&& login.method === request.method) {
|
||||
const urlObj = isHttp(request.url, login.host);
|
||||
if (login.host.toLowerCase() === urlObj.hostname.toLowerCase()
|
||||
&& login.orderQuery.toLowerCase() === urlObj.pathname.toLowerCase()
|
||||
&& login.method.toLowerCase() === request.method.toLowerCase()) {
|
||||
const jsonData = JSON.parse(request.request);
|
||||
const acc = eval(`jsonData.${login.accPath}`);
|
||||
const psw = eval(`jsonData.${login.pswPath}`);
|
||||
@ -60,53 +32,51 @@ function extractLoginInfo(request, logins) {
|
||||
'账号': acc,
|
||||
'密码': psw
|
||||
};
|
||||
console.log(login.name);
|
||||
console.log('-----' + login.name + '-----');
|
||||
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 重写
|
||||
var oldOpen = XMLHttpRequest.prototype.open;
|
||||
var oldSend = XMLHttpRequest.prototype.send;
|
||||
XMLHttpRequest.prototype.open = function (method, url) {
|
||||
this._url = url;
|
||||
this._method = method;
|
||||
const res = {
|
||||
url: this.responseURL,
|
||||
method: this._method,
|
||||
response: this._body
|
||||
}
|
||||
extractLoginInfo(res, logins);
|
||||
return oldOpen.apply(this, arguments);
|
||||
};
|
||||
XMLHttpRequest.prototype.send = function (body) {
|
||||
this._body = body;
|
||||
this.addEventListener('load', function () {
|
||||
const res = {
|
||||
url: this.responseURL,
|
||||
method: this._method,
|
||||
response: this.responseText
|
||||
}
|
||||
console.log(res);
|
||||
|
||||
extractOrderInfo(res, plugins);
|
||||
});
|
||||
const res = {
|
||||
url: this._url,
|
||||
method: this._method,
|
||||
request: this._body
|
||||
}
|
||||
extractLoginInfo(res, logins);
|
||||
return oldSend.apply(this, arguments);
|
||||
};
|
||||
|
||||
// fetch 重写
|
||||
window.au_fetch = window.fetch;
|
||||
window.fetch = function (url, options) {
|
||||
// console.log('Fetch URL:', url);
|
||||
// console.log('Fetch Options:', options);
|
||||
const res = {
|
||||
url: url,
|
||||
method: options.method,
|
||||
request: options.body
|
||||
}
|
||||
extractLoginInfo(res, logins);
|
||||
return window.au_fetch.apply(window, [url, options]).then((response) => {
|
||||
const res = {
|
||||
url: url,
|
||||
method: options.method,
|
||||
response: response.text()
|
||||
}
|
||||
extractOrderInfo(res, plugins);
|
||||
return response;
|
||||
});
|
||||
};
|
@ -483,7 +483,7 @@
|
||||
// 点击事件
|
||||
util.on({
|
||||
'load': () => {
|
||||
util.openWin({ url: 'https://gitee.com/technical-laohu/mpay' });
|
||||
util.openWin({ url: 'https://gitee.com/technical-laohu/mpay/releases' });
|
||||
},
|
||||
'doc': () => {
|
||||
util.openWin({ url: 'https://f0bmwzqjtq2.feishu.cn/docx/HBVrdrsACo36bzxUCSPcjOBNnyb?from=from_copylink' });
|
||||
|
Loading…
Reference in New Issue
Block a user