Skip to content

Commit

Permalink
🐛 (微信公众号宁波银行): 修复交易类型判断逻辑 #264
Browse files Browse the repository at this point in the history
修复了交易类型判断逻辑, 现在可以正确识别“网络支付退款”类型的交易。
  • Loading branch information
AnkioTomas committed Sep 19, 2024
1 parent 9d12baf commit d0b3eb2
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ const regexMapBOC = [
[
//交易类型:尾号2582-工资-人民币\n交易时间:09月15日 17:00\n交易对象:大夏公司\n交易金额:1696.49\n可用余额:428.97
//交易类型:尾号2582-网络支付消费-人民币\n交易时间:09月16日 10:29\n交易对象:拼多多平台商户\n交易金额:58.75\n可用余额:370.22
//交易类型:尾号2582-网络支付退款-人民币\n交易时间:09月17日 11:35\n交易对象:上海付费通信息服务有限公司\n交易金额:-3.99\n可用余额:374.21
/交易类型:尾号(\d{4})-(.*?)-人民币\n交易时间:(.*?)\n交易对象:(.*?)\n交易金额:([\d,]+.\d{2})\n可用余额:([\d,]+.\d{2})$/,
match => {
let [,number,shopItem,time,shopName,money,] = match
let billType = BillType.Income;
if (shopItem.indexOf("消费") !==-1 || shopItem.indexOf("支付")!==-1){
if (shopItem.indexOf("消费") !==-1 ){
billType = BillType.Expend;
}

Expand Down

1 comment on commit d0b3eb2

@Disky
Copy link

@Disky Disky commented on d0b3eb2 Sep 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//交易类型:尾号2582-网络支付退款-人民币\n交易时间:09月17日 11:35\n交易对象:上海付费通信息服务有限公司\n交易金额:-3.99\n可用余额:374.21

退款交易金额为负数,规则未匹配

Please sign in to comment.