From 91def4415e7e89329b61c3addcd8330c7b5181f2 Mon Sep 17 00:00:00 2001 From: ankio Date: Wed, 18 Dec 2024 12:41:42 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20(=E5=BE=AE=E4=BF=A1=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E6=89=AB=E7=A0=81=E6=94=AF=E4=BB=98):=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=89=AB=E7=A0=81=E6=94=AF=E4=BB=98=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E5=8F=8A=E6=AD=A3=E5=88=99=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E8=A7=84=E5=88=99=20#477?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增微信支付扫码支付的测试文件 `微信支付扫码付款5.txt`,并更新 `main.test.js` 和 `main.js` 文件,添加针对零钱支付的测试用例和正则匹配规则,以支持车牌号和交易状态的解析。 --- .../main.js" | 20 +++++++++++++++++++ .../main.test.js" | 12 +++++++++++ ...\347\240\201\344\273\230\346\254\2765.txt" | 16 +++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 "src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230\346\211\253\347\240\201\346\224\257\344\273\230/tests/\345\276\256\344\277\241\346\224\257\344\273\230\346\211\253\347\240\201\344\273\230\346\254\2765.txt" diff --git "a/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230\346\211\253\347\240\201\346\224\257\344\273\230/main.js" "b/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230\346\211\253\347\240\201\346\224\257\344\273\230/main.js" index 626bcaa..169e6d9 100644 --- "a/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230\346\211\253\347\240\201\346\224\257\344\273\230/main.js" +++ "b/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230\346\211\253\347\240\201\346\224\257\344\273\230/main.js" @@ -68,6 +68,7 @@ const rules =[ }, ], [ + //使用零钱支付¥17.30\n车牌宁A·T4386\n交易状态支付成功,对方已收款 /使用(.*?)支付¥(\d+\.\d{2})\n交易(状态|狀態)支付成功,([对對])方已收款/, (match,t,item) => { let [, accountNameFrom, money] = match; @@ -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, + '微信[微信支付-付款]' + ); + }, ], ]; diff --git "a/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230\346\211\253\347\240\201\346\224\257\344\273\230/main.test.js" "b/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230\346\211\253\347\240\201\346\224\257\344\273\230/main.test.js" index 6b3c71d..73df5c8 100644 --- "a/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230\346\211\253\347\240\201\346\224\257\344\273\230/main.test.js" +++ "b/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230\346\211\253\347\240\201\346\224\257\344\273\230/main.test.js" @@ -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": '微信[微信支付-付款]', + }, ])); diff --git "a/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230\346\211\253\347\240\201\346\224\257\344\273\230/tests/\345\276\256\344\277\241\346\224\257\344\273\230\346\211\253\347\240\201\344\273\230\346\254\2765.txt" "b/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230\346\211\253\347\240\201\346\224\257\344\273\230/tests/\345\276\256\344\277\241\346\224\257\344\273\230\346\211\253\347\240\201\344\273\230\346\254\2765.txt" new file mode 100644 index 0000000..a2fb18c --- /dev/null +++ "b/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230\346\211\253\347\240\201\346\224\257\344\273\230/tests/\345\276\256\344\277\241\346\224\257\344\273\230\346\211\253\347\240\201\344\273\230\346\254\2765.txt" @@ -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 +} +}