| @@ 69-74 (lines=6) @@ | ||
| 66 | // IBAN |
|
| 67 | $transactionData = str_replace('Europese Incasso, doorlopend ', '', $this->getCurrentTransactionData()); |
|
| 68 | $transactionData = preg_replace('![\r\n]+!', '', $transactionData); |
|
| 69 | if (preg_match('#/CNTP/[^/]*/[^/]*/(.*?)/#', $transactionData, $results)) { |
|
| 70 | $name = trim($results[1]); |
|
| 71 | if (!empty($name)) { |
|
| 72 | return $this->sanitizeAccountName($name); |
|
| 73 | } |
|
| 74 | } |
|
| 75 | if (preg_match('#:86:.*? [^ ]+ (.*)#', $transactionData, $results) !== 1) { |
|
| 76 | return ''; |
|
| 77 | } |
|
| @@ 89-94 (lines=6) @@ | ||
| 86 | */ |
|
| 87 | private function parseNameFromTransactionData($transactionData) |
|
| 88 | { |
|
| 89 | if (preg_match('#(.*) (Not-Provided|NOTPROVIDED)#', $transactionData, $results) === 1) { |
|
| 90 | $name = trim($results[1]); |
|
| 91 | if (!empty($name)) { |
|
| 92 | return $this->sanitizeAccountName($name); |
|
| 93 | } |
|
| 94 | } |
|
| 95 | ||
| 96 | if (preg_match('#\D+#', $transactionData, $results)) { |
|
| 97 | $name = trim($results[0]); |
|
| @@ 96-101 (lines=6) @@ | ||
| 93 | } |
|
| 94 | } |
|
| 95 | ||
| 96 | if (preg_match('#\D+#', $transactionData, $results)) { |
|
| 97 | $name = trim($results[0]); |
|
| 98 | if (!empty($name)) { |
|
| 99 | return $this->sanitizeAccountName($name); |
|
| 100 | } |
|
| 101 | } |
|
| 102 | ||
| 103 | return ''; |
|
| 104 | } |
|
| @@ 63-68 (lines=6) @@ | ||
| 60 | } |
|
| 61 | } |
|
| 62 | ||
| 63 | if (preg_match('/^:61:.*? (.+)/m', $this->getCurrentTransactionData(), $results)) { |
|
| 64 | $accountName = trim($results[1]); |
|
| 65 | if (!empty($accountName)) { |
|
| 66 | return $this->sanitizeAccountName($accountName); |
|
| 67 | } |
|
| 68 | } |
|
| 69 | ||
| 70 | if (preg_match('/(.*) Betaalautomaat/', $this->parseTransactionDescription(), $results)) { |
|
| 71 | $accountName = trim($results[1]); |
|
| @@ 70-75 (lines=6) @@ | ||
| 67 | } |
|
| 68 | } |
|
| 69 | ||
| 70 | if (preg_match('/(.*) Betaalautomaat/', $this->parseTransactionDescription(), $results)) { |
|
| 71 | $accountName = trim($results[1]); |
|
| 72 | if (!empty($accountName)) { |
|
| 73 | return $this->sanitizeAccountName($accountName); |
|
| 74 | } |
|
| 75 | } |
|
| 76 | return ''; |
|
| 77 | } |
|
| 78 | ||
| @@ 91-98 (lines=8) @@ | ||
| 88 | $results = []; |
|
| 89 | ||
| 90 | // SEPA MT940 Structured |
|
| 91 | if (preg_match('#/NAME/(.*?)/(EREF|REMI|ADDR)/#ms', $this->getCurrentTransactionData(), $results) |
|
| 92 | && !empty($results[1]) |
|
| 93 | ) { |
|
| 94 | $accountName = trim($results[1]); |
|
| 95 | if (!empty($accountName)) { |
|
| 96 | return $this->sanitizeAccountName($accountName); |
|
| 97 | } |
|
| 98 | } |
|
| 99 | ||
| 100 | if (preg_match('/NAAM: (.+)/', $this->getCurrentTransactionData(), $results) |
|
| 101 | && !empty($results[1]) |
|