From cc5783bfafcdcb63a26cd1fb1c22a4401796aa55 Mon Sep 17 00:00:00 2001 From: Julian Gums Date: Tue, 12 Nov 2024 15:21:29 +0200 Subject: [PATCH 1/5] Update Message.php --- src/Camt053/Decoder/Message.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Camt053/Decoder/Message.php b/src/Camt053/Decoder/Message.php index 321009a..9d317f5 100644 --- a/src/Camt053/Decoder/Message.php +++ b/src/Camt053/Decoder/Message.php @@ -55,6 +55,10 @@ public function getRootElement(SimpleXMLElement $document): SimpleXMLElement protected function getAccount(SimpleXMLElement $xmlRecord): DTO\Account { + if (isset($xmlRecord->Acct->Nm)) { + return new DTO\NamedAccount(new Iban((string) $xmlRecord->Acct->Id->IBAN), $xmlRecord->Acct->Nm); + } + if (isset($xmlRecord->Acct->Id->IBAN)) { return new DTO\IbanAccount(new Iban((string) $xmlRecord->Acct->Id->IBAN)); } From 1d1cc245c3011fa73325488497b8e61b05690ee8 Mon Sep 17 00:00:00 2001 From: Julian Gums Date: Tue, 12 Nov 2024 15:23:19 +0200 Subject: [PATCH 2/5] Update Message.php --- src/Camt053/Decoder/Message.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Camt053/Decoder/Message.php b/src/Camt053/Decoder/Message.php index 9d317f5..76a2668 100644 --- a/src/Camt053/Decoder/Message.php +++ b/src/Camt053/Decoder/Message.php @@ -56,7 +56,7 @@ public function getRootElement(SimpleXMLElement $document): SimpleXMLElement protected function getAccount(SimpleXMLElement $xmlRecord): DTO\Account { if (isset($xmlRecord->Acct->Nm)) { - return new DTO\NamedAccount(new Iban((string) $xmlRecord->Acct->Id->IBAN), $xmlRecord->Acct->Nm); + return new DTO\NamedAccount(new Iban((string) $xmlRecord->Acct->Id->IBAN), (string) $xmlRecord->Acct->Nm); } if (isset($xmlRecord->Acct->Id->IBAN)) { From 852158c6efe745ac13a4878c4e21a6480403f838 Mon Sep 17 00:00:00 2001 From: Julian Gums Date: Tue, 12 Nov 2024 15:23:42 +0200 Subject: [PATCH 3/5] Update Message.php --- src/Camt052/Decoder/Message.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Camt052/Decoder/Message.php b/src/Camt052/Decoder/Message.php index 0f45f4f..1b2aec9 100644 --- a/src/Camt052/Decoder/Message.php +++ b/src/Camt052/Decoder/Message.php @@ -49,6 +49,10 @@ public function addRecords(DTO\Message $message, SimpleXMLElement $document): vo protected function getAccount(SimpleXMLElement $xmlRecord): Account { + if (isset($xmlRecord->Acct->Nm)) { + return new DTO\NamedAccount(new Iban((string) $xmlRecord->Acct->Id->IBAN), (string) $xmlRecord->Acct->Nm); + } + if (isset($xmlRecord->Acct->Id->IBAN)) { return new DTO\IbanAccount(new Iban((string) $xmlRecord->Acct->Id->IBAN)); } From ba4319d2dbb7f71ecee98ef3a081b129117ccbed Mon Sep 17 00:00:00 2001 From: Julian Gums Date: Tue, 12 Nov 2024 15:24:16 +0200 Subject: [PATCH 4/5] Update Message.php --- src/Camt054/Decoder/Message.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Camt054/Decoder/Message.php b/src/Camt054/Decoder/Message.php index 6f73f2d..fa8cf77 100644 --- a/src/Camt054/Decoder/Message.php +++ b/src/Camt054/Decoder/Message.php @@ -56,6 +56,10 @@ public function getRootElement(SimpleXMLElement $document): SimpleXMLElement protected function getAccount(SimpleXMLElement $xmlRecord): Account { + if (isset($xmlRecord->Acct->Nm)) { + return new DTO\NamedAccount(new Iban((string) $xmlRecord->Acct->Id->IBAN), (string) $xmlRecord->Acct->Nm); + } + if (isset($xmlRecord->Acct->Id->IBAN)) { return new DTO\IbanAccount(new Iban((string) $xmlRecord->Acct->Id->IBAN)); } From 9dc99674978260ecc1a8a33f662b986dce711825 Mon Sep 17 00:00:00 2001 From: Julian Gums Date: Tue, 12 Nov 2024 16:17:06 +0200 Subject: [PATCH 5/5] Create NamedAccount.php --- src/DTO/NamedAccount.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/DTO/NamedAccount.php diff --git a/src/DTO/NamedAccount.php b/src/DTO/NamedAccount.php new file mode 100644 index 0000000..19db008 --- /dev/null +++ b/src/DTO/NamedAccount.php @@ -0,0 +1,38 @@ +iban = $iban; + $this->name = $name; + } + + public function getIban(): Iban + { + return $this->iban; + } + + public function getName(): string + { + return $this->name; + } + + /** + * @inheritDoc + */ + public function getIdentification(): string + { + return (string) $this->iban; + } +}