Skip to content

Commit ab22445

Browse files
author
Robert Becker
committed
Add kontonummer to HIUPDv6 if IBAN is not available
1 parent dbcd76f commit ab22445

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ 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)) return $this->iban == $account->getIban();
57+
// Sparkasse (Koblenz) does not provide an IBAN in this segment, fall back to kontonummer:
58+
return !is_null($this->kontoverbindung->kontonummer) && $this->kontoverbindung->kontonummer == $account->getAccountNumber();
5759
}
5860

5961
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)