Skip to content

Commit

Permalink
✨ (微信支付扫码支付): 新增扫码支付测试用例及正则匹配规则 #477
Browse files Browse the repository at this point in the history
新增微信支付扫码支付的测试文件 `微信支付扫码付款5.txt`,并更新 `main.test.js` 和 `main.js` 文件,添加针对零钱支付的测试用例和正则匹配规则,以支持车牌号和交易状态的解析。
  • Loading branch information
AnkioTomas committed Dec 18, 2024
1 parent 00a5018 commit 91def44
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/rule/com.tencent.mm/app/微信支付扫码支付/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const rules =[
},
],
[
//使用零钱支付¥17.30\n车牌宁A·T4386\n交易状态支付成功,对方已收款
/使用(.*?)支付¥(\d+\.\d{2})\n交易(状态|狀態)支付成功,([对對])方已收款/,
(match,t,item) => {
let [, accountNameFrom, money] = match;
Expand All @@ -84,6 +85,25 @@ const rules =[
'微信[微信支付-付款]'
);
},
],
[
//使用零钱支付¥17.30\n车牌宁A·T4386\n交易状态支付成功,对方已收款
/使用(.*?)支付¥(\d+\.\d{2})\n车牌(.*?)\n交易(状态|狀態)支付成功,([对對])方已收款/,
(match,t,item) => {
let [, accountNameFrom, money,shopItem] = match;
return new RuleObject(
BillType.Expend,
toFloat(money),
item.display_name,
shopItem,
accountNameFrom,
'',
0.0,
Currency['人民币'],
t,
'微信[微信支付-付款]'
);
},
],
];

Expand Down
12 changes: 12 additions & 0 deletions src/rule/com.tencent.mm/app/微信支付扫码支付/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,16 @@ test('微信支付扫码付款', () =>
"time": 1727788529055,
"channel": '微信[微信支付-付款]',
},
{
"type": "Expend",
"money": 17.3,
"fee": 0,
"shopName": '冰达4386马金峰',
"shopItem": '宁A·T4386',
"accountNameFrom": '零钱',
"accountNameTo": '',
"currency": 'CNY',
"time": 1731045490128,
"channel": '微信[微信支付-付款]',
},
]));
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"mMap": {
"description": "使用零钱支付¥17.30\n车牌宁A·T4386\n交易状态支付成功,对方已收款",
"source": "微信支付",
"type": 5,
"appId": "",
"msgId": 99064,
"title": "已支付¥17.30",
"display_name": "冰达4386马金峰",
"hookerUser": "景旺",
"cachedPayTools": "零钱",
"cachedPayMoney": "¥17.30",
"cachedPayShop": "付款给冰达4386马金峰(**娟)",
"t": 1731045490128
}
}

0 comments on commit 91def44

Please sign in to comment.