Skip to content

Commit

Permalink
added new blz for Commerzbank (#51)
Browse files Browse the repository at this point in the history
* added BLZ 25040066
* added unique identifier 01LGX08DLMWH5GWA

---------

Co-authored-by: Lars Herrmann <lars.herrmann@power.cloud>
  • Loading branch information
larsiinger and Lars Herrmann authored Nov 6, 2023
1 parent 482bccc commit 2520146
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Jejik/MT940/Parser/Commerzbank.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ public function accept(string $text): bool
$allowedUniqueIdentifiers = [
':20:012CIXCIA7V1OGWA',
':20:0157VSNLKBG9WGWA',
':20:01LGX08DLMWH5GWA',
];

// unique identifier check
$mt940Identifier = substr($text, 0, 20);
if (in_array($mt940Identifier, $allowedUniqueIdentifiers)) {

if (in_array($mt940Identifier, $allowedUniqueIdentifiers, true)) {
return true;
}

Expand All @@ -49,7 +51,8 @@ public function getAllowedBLZ(): array
return [
'70040041',
'66280053',
'28540034'
'28540034',
'25040066',
];
}
}
14 changes: 14 additions & 0 deletions tests/Jejik/Tests/MT940/Fixture/document/commerzbank.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
:20:01LGX08DLMWH5GWA
:25:25040066/0123456789
:28C:00143/1
:60F:C200605EUR0,00
:61:2006080608D12,35 NRTIKREF+//2016021783252833
/OCMT/EUR11,85//CHGS/EUR0,50/
:86:109?00SEPA-LASTSCHR. RETOURE CORE?109075/629?20EREF+A1.200080779.
400143254?21.4961336 KREF+SEPA-DA202006?2201221740-34972000-P1 MR
EF+2?230852HW2723821 CRED+DE41EON0?240000129793 OAMT+11,85 SVWZ+?
25SONSTIGE GRUENDE ENDABRECHN?26UNG NR. 500106875 ZU VERTRA?2740
0143254, KUNDENNUM MER 2?2802227779?30CSDBDE71XXX?31DE50712345600
200691329?32TESTER?33EL
:62F:C200608EUR0,00
-
29 changes: 29 additions & 0 deletions tests/Jejik/Tests/MT940/Parser/CommerzbankTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace Jejik\Tests\MT940\Parser;

use Jejik\MT940\Parser\Commerzbank;
use Jejik\MT940\Reader;
use PHPUnit\Framework\TestCase;

class CommerzbankTest extends TestCase
{
private Reader $reader;

public function setUp(): void
{
$this->reader = new Reader();
$this->reader->addParser('Commerzbank', Commerzbank::class);

$this->context = file_get_contents(__DIR__ . '/../Fixture/document/commerzbank.txt');
}

public function testPassAccept(): void
{
$parser = $this->reader->getStatements($this->context);

self::assertIsArray($parser);
}
}

0 comments on commit 2520146

Please sign in to comment.