Skip to content

Commit d1a75a2

Browse files
authored
Merge pull request #528 from roben/HIUPDv6-sparkasse
Add kontonummer fallback to HIUPDv6 if IBAN is not available
2 parents 71df0a0 + 27e0dac commit d1a75a2

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.DS_Store
22
.idea/
3+
.vscode/
34
vendor/
45
develop/
56
coverage/

lib/Fhp/Segment/HIUPD/HIUPDv6.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ class HIUPDv6 extends BaseSegment implements HIUPD
5353

5454
public function matchesAccount(SEPAAccount $account): bool
5555
{
56-
return !is_null($this->iban) && $this->iban == $account->getIban();
56+
if (!is_null($this->iban)) {
57+
return $this->iban == $account->getIban();
58+
}
59+
// Sparkasse (Koblenz) does not provide an IBAN in this segment, fall back to kontonummer:
60+
return !is_null($this->kontoverbindung->kontonummer) && $this->kontoverbindung->kontonummer == $account->getAccountNumber();
5761
}
5862

5963
public function getErlaubteGeschaeftsvorfaelle(): array

lib/Fhp/Syntax/Serializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public static function serializeSegment(BaseSegment $segment): string
7777
*/
7878
public static function serializeSegments(array $segments): string
7979
{
80-
return implode(array_map(['self', 'serializeSegment'], $segments));
80+
return implode(array_map([self::class, 'serializeSegment'], $segments));
8181
}
8282

8383
/**

0 commit comments

Comments
 (0)