| @@ 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 | } |
|
| @@ 89-96 (lines=8) @@ | ||
| 86 | $results = []; |
|
| 87 | ||
| 88 | // SEPA MT940 Structured |
|
| 89 | if (preg_match('#/NAME/(.*?)/(EREF|REMI|ADDR)/#ms', $this->getCurrentTransactionData(), $results) |
|
| 90 | && !empty($results[1]) |
|
| 91 | ) { |
|
| 92 | $accountName = trim($results[1]); |
|
| 93 | if (!empty($accountName)) { |
|
| 94 | return $this->sanitizeAccountName($accountName); |
|
| 95 | } |
|
| 96 | } |
|
| 97 | ||
| 98 | if (preg_match('/NAAM: (.+)/', $this->getCurrentTransactionData(), $results) |
|
| 99 | && !empty($results[1]) |
|
| @@ 56-63 (lines=8) @@ | ||
| 53 | { |
|
| 54 | $results = []; |
|
| 55 | // SEPA MT940 Structured |
|
| 56 | if (preg_match('#/NAME/(.*?)/(REMI|ADDR)/#ms', $this->getCurrentTransactionData(), $results) |
|
| 57 | && !empty($results[1]) |
|
| 58 | ) { |
|
| 59 | $accountName = trim($results[1]); |
|
| 60 | if (!empty($accountName)) { |
|
| 61 | return $this->sanitizeAccountName($accountName); |
|
| 62 | } |
|
| 63 | } |
|
| 64 | ||
| 65 | if (preg_match('/^:61:.*? (.*)/m', $this->getCurrentTransactionData(), $results) && !empty($results[1])) { |
|
| 66 | $accountName = trim($results[1]); |
|
| @@ 65-70 (lines=6) @@ | ||
| 62 | } |
|
| 63 | } |
|
| 64 | ||
| 65 | if (preg_match('/^:61:.*? (.*)/m', $this->getCurrentTransactionData(), $results) && !empty($results[1])) { |
|
| 66 | $accountName = trim($results[1]); |
|
| 67 | if (!empty($accountName)) { |
|
| 68 | return $this->sanitizeAccountName($accountName); |
|
| 69 | } |
|
| 70 | } |
|
| 71 | ||
| 72 | return ''; |
|
| 73 | } |
|