Skip to content

Commit

Permalink
🐛 (rule): 优化美团月付支出规则,支持成功下单 #440
Browse files Browse the repository at this point in the history
修复了美团月付支出规则无法识别成功下单通知的问题,
现在规则可以正确识别成功支付和成功下单两种通知。
  • Loading branch information
AnkioTomas committed Oct 18, 2024
1 parent f221529 commit 53ecabd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import { BillType, formatDate, RuleObject, toFloat } from 'common/index.js';
export function get(data) {
let json = JSON.parse(data)
// 【美团月付】成功支付126.00元
//【美团月付】成功下单17.23元
// let regex = /您尾号(\d{4})的招行一卡通入账人民币([\d,]+.\d{2})元/
let regex = /【美团月付】成功支付([\d,]+.\d{2})元/
let regex = /【美团月付】成功(支付|下单)([\d,]+.\d{2})元/
const match = json.title.match(regex);
if (!match) {
return null;
}
let [,money] = match;
let [,,money] = match;
let obj = new RuleObject();

obj.money = toFloat(money);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,16 @@ test('美团月付支出', () =>
"time": 1729028895496,
"channel": '美团月付[支出]',
},
{
"type": "Expend",
"money": 17.23,
"fee": 0,
"shopName": '美团',
"shopItem": '还款日每月8号,记得按时还款,查看订单详情>>',
"accountNameFrom": '美团月付',
"accountNameTo": '',
"currency": 'CNY',
"time": 1728986881286,
"channel": '美团月付[支出]',
},
]));
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"title": "【美团月付】成功下单17.23元",
"text": "还款日每月8号,记得按时还款,查看订单详情>>",
"t": 1728986881286
}

0 comments on commit 53ecabd

Please sign in to comment.