-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MessageFormat V06 for Camt052 messages
- Loading branch information
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Genkgo\Camt\Camt052\Decoder\V06; | ||
|
||
use Genkgo\Camt\Camt052\Decoder\Message as BaseMessageDecoder; | ||
use \SimpleXMLElement; | ||
|
||
class Message extends BaseMessageDecoder | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getRootElement(SimpleXMLElement $document): SimpleXMLElement | ||
{ | ||
return $document->BkToCstmrAcctRpt; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Genkgo\Camt\Camt052\MessageFormat; | ||
|
||
use Genkgo\Camt\Camt052; | ||
use Genkgo\Camt\Decoder; | ||
use Genkgo\Camt\DecoderInterface; | ||
use Genkgo\Camt\MessageFormatInterface; | ||
|
||
/** | ||
* Class MessageFormat | ||
* @package Genkgo\Camt\Camt052 | ||
*/ | ||
final class V06 implements MessageFormatInterface | ||
{ | ||
/** | ||
* @return string | ||
*/ | ||
public function getXmlNs(): string | ||
{ | ||
return 'urn:iso:std:iso:20022:tech:xsd:camt.052.001.06'; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getMsgId(): string | ||
{ | ||
return 'camt.052.001.06'; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getName(): string | ||
{ | ||
return 'BankToCustomerAccountReportV06'; | ||
} | ||
|
||
/** | ||
* @return DecoderInterface | ||
*/ | ||
public function getDecoder(): DecoderInterface | ||
{ | ||
$entryTransactionDetailDecoder = new Camt052\Decoder\EntryTransactionDetail(new Decoder\Date()); | ||
$entryDecoder = new Decoder\Entry($entryTransactionDetailDecoder); | ||
$recordDecoder = new Decoder\Record($entryDecoder, new Decoder\Date()); | ||
$messageDecoder = new Camt052\Decoder\V06\Message($recordDecoder, new Decoder\Date()); | ||
|
||
return new Decoder($messageDecoder, sprintf('/assets/%s.xsd', $this->getMsgId())); | ||
} | ||
} |