Skip to content

Commit

Permalink
Add support for UUID for end-to-end reference of a payment transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerKiKi committed Feb 12, 2023
1 parent 5de970a commit 51c1533
Show file tree
Hide file tree
Showing 16 changed files with 198 additions and 18 deletions.
15 changes: 15 additions & 0 deletions src/DTO/Reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class Reference

private ?string $endToEndId = null;

private ?string $uuidEndToEndReference = null;

private ?string $transactionId = null;

private ?string $mandateId = null;
Expand Down Expand Up @@ -97,6 +99,19 @@ public function setEndToEndId(?string $endToEndId): self
return $this;
}

/**
* Universally unique identifier to provide an end-to-end reference of a payment transaction.
*/
public function getUuidEndToEndReference(): ?string
{
return $this->uuidEndToEndReference;
}

public function setUuidEndToEndReference(?string $uuidEndToEndReference): void
{
$this->uuidEndToEndReference = $uuidEndToEndReference;
}

public function getTransactionId(): ?string
{
return $this->transactionId;
Expand Down
1 change: 1 addition & 0 deletions src/Decoder/EntryTransactionDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public function addReference(DTO\EntryTransactionDetail $detail, SimpleXMLElemen
$reference->setPaymentInformationId(isset($refs->PmtInfId) ? (string) $refs->PmtInfId : null);
$reference->setInstructionId(isset($refs->InstrId) ? (string) $refs->InstrId : null);
$reference->setEndToEndId(isset($refs->EndToEndId) ? (string) $refs->EndToEndId : null);
$reference->setUuidEndToEndReference(isset($refs->UETR) ? (string) $refs->UETR : null);
$reference->setTransactionId(isset($refs->TxId) ? (string) $refs->TxId : null);
$reference->setMandateId(isset($refs->MndtId) ? (string) $refs->MndtId : null);
$reference->setChequeNumber(isset($refs->ChqNb) ? (string) $refs->ChqNb : null);
Expand Down
3 changes: 2 additions & 1 deletion test/Unit/RegressionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public static function providerRegression(): iterable
yield ['test/data/camt053.v4.xml'];
yield ['test/data/camt054.v2.xml'];
yield ['test/data/camt054.v4.xml'];
yield ['test/data/camt054.v8.xml'];
yield ['test/data/camt054.v8-with-UETR.xml'];
yield ['test/data/camt054.v8-with-financial-institution.xml'];
yield ['test/data/camt054.v8.xml'];
}
}
3 changes: 2 additions & 1 deletion test/data/camt052.v4.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@
"getPaymentInformationId": null,
"getProcessingId": null,
"getProprietaries": [],
"getTransactionId": null
"getTransactionId": null,
"getUuidEndToEndReference": null
},
"getRelatedAgent": {
"__CLASS__": "Genkgo\\Camt\\DTO\\RelatedAgent",
Expand Down
3 changes: 2 additions & 1 deletion test/data/camt052.v6.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@
"getPaymentInformationId": null,
"getProcessingId": null,
"getProprietaries": [],
"getTransactionId": null
"getTransactionId": null,
"getUuidEndToEndReference": null
},
"getRelatedAgent": {
"__CLASS__": "Genkgo\\Camt\\DTO\\RelatedAgent",
Expand Down
3 changes: 2 additions & 1 deletion test/data/camt053.v2.five.decimals.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
"getPaymentInformationId": null,
"getProcessingId": null,
"getProprietaries": [],
"getTransactionId": null
"getTransactionId": null,
"getUuidEndToEndReference": null
},
"getRelatedAgent": null,
"getRelatedAgents": [],
Expand Down
3 changes: 2 additions & 1 deletion test/data/camt053.v2.minimal.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@
"getType": "LegalSequenceNumber"
}
],
"getTransactionId": null
"getTransactionId": null,
"getUuidEndToEndReference": null
},
"getRelatedAgent": null,
"getRelatedAgents": [],
Expand Down
3 changes: 2 additions & 1 deletion test/data/camt053.v2.minimal.ultimate.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@
"getType": "LegalSequenceNumber"
}
],
"getTransactionId": null
"getTransactionId": null,
"getUuidEndToEndReference": null
},
"getRelatedAgent": null,
"getRelatedAgents": [],
Expand Down
3 changes: 2 additions & 1 deletion test/data/camt053.v2.multi.statement.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
"getPaymentInformationId": null,
"getProcessingId": null,
"getProprietaries": [],
"getTransactionId": null
"getTransactionId": null,
"getUuidEndToEndReference": null
},
"getRelatedAgent": null,
"getRelatedAgents": [],
Expand Down
3 changes: 2 additions & 1 deletion test/data/camt053.v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
"getType": "LegalSequenceNumber"
}
],
"getTransactionId": null
"getTransactionId": null,
"getUuidEndToEndReference": null
},
"getRelatedAgent": {
"__CLASS__": "Genkgo\\Camt\\DTO\\RelatedAgent",
Expand Down
3 changes: 2 additions & 1 deletion test/data/camt053.v4.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@
"getType": "LegalSequenceNumber"
}
],
"getTransactionId": null
"getTransactionId": null,
"getUuidEndToEndReference": null
},
"getRelatedAgent": null,
"getRelatedAgents": [],
Expand Down
9 changes: 6 additions & 3 deletions test/data/camt054.v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
"getPaymentInformationId": null,
"getProcessingId": null,
"getProprietaries": [],
"getTransactionId": null
"getTransactionId": null,
"getUuidEndToEndReference": null
},
"getRelatedAgent": null,
"getRelatedAgents": [],
Expand Down Expand Up @@ -164,7 +165,8 @@
"getPaymentInformationId": null,
"getProcessingId": null,
"getProprietaries": [],
"getTransactionId": null
"getTransactionId": null,
"getUuidEndToEndReference": null
},
"getRelatedAgent": null,
"getRelatedAgents": [],
Expand Down Expand Up @@ -229,7 +231,8 @@
"getPaymentInformationId": null,
"getProcessingId": null,
"getProprietaries": [],
"getTransactionId": null
"getTransactionId": null,
"getUuidEndToEndReference": null
},
"getRelatedAgent": null,
"getRelatedAgents": [],
Expand Down
9 changes: 6 additions & 3 deletions test/data/camt054.v4.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@
"getPaymentInformationId": "UXC06170000006PI00001",
"getProcessingId": null,
"getProprietaries": [],
"getTransactionId": null
"getTransactionId": null,
"getUuidEndToEndReference": null
},
"getRelatedAgent": {
"__CLASS__": "Genkgo\\Camt\\DTO\\RelatedAgent",
Expand Down Expand Up @@ -276,7 +277,8 @@
"getPaymentInformationId": "UXC06170000006PI00001",
"getProcessingId": null,
"getProprietaries": [],
"getTransactionId": null
"getTransactionId": null,
"getUuidEndToEndReference": null
},
"getRelatedAgent": {
"__CLASS__": "Genkgo\\Camt\\DTO\\RelatedAgent",
Expand Down Expand Up @@ -418,7 +420,8 @@
"getPaymentInformationId": "UXC06170000006PI00001",
"getProcessingId": null,
"getProprietaries": [],
"getTransactionId": null
"getTransactionId": null,
"getUuidEndToEndReference": null
},
"getRelatedAgent": {
"__CLASS__": "Genkgo\\Camt\\DTO\\RelatedAgent",
Expand Down
112 changes: 112 additions & 0 deletions test/data/camt054.v8-with-UETR.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"__CLASS__": "Genkgo\\Camt\\DTO\\Message",
"getEntries": [
{
"__CLASS__": "Genkgo\\Camt\\DTO\\Entry",
"getAccountServicerReference": null,
"getAdditionalInfo": "",
"getAmount": {
"__CLASS__": "Money\\Money",
"getAmount": "-20000000",
"getCurrency": {
"__CLASS__": "Money\\Currency",
"getCode": "SEK"
}
},
"getBankTransactionCode": {
"__CLASS__": "Genkgo\\Camt\\DTO\\BankTransactionCode",
"getDomain": null,
"getProprietary": null
},
"getBatchPaymentId": null,
"getBookingDate": null,
"getCharges": null,
"getIndex": 0,
"getRecord": {
"__CLASS__": "Genkgo\\Camt\\Camt054\\DTO\\Notification",
"getAccount": {
"__CLASS__": "Genkgo\\Camt\\DTO\\IbanAccount",
"getIban": {
"__CLASS__": "Genkgo\\Camt\\Iban",
"getIban": "CH2801234000123456789"
},
"getIdentification": "CH2801234000123456789"
},
"getAdditionalInformation": null,
"getCopyDuplicateIndicator": null,
"getCreatedOn": {
"__CLASS__": "DateTimeImmutable",
"0": "2007-10-18T11:30:00+00:00"
},
"getElectronicSequenceNumber": null,
"getEntries": [
"__RECURSIVITY__"
],
"getFromDate": null,
"getId": "AAAASESS-FP-ACCR001",
"getLegalSequenceNumber": null,
"getPagination": null,
"getToDate": null
},
"getReference": null,
"getReversalIndicator": false,
"getStatus": "BOOK",
"getTransactionDetail": {
"__CLASS__": "Genkgo\\Camt\\DTO\\EntryTransactionDetail",
"getAdditionalTransactionInformation": null,
"getAmount": null,
"getAmountDetails": null,
"getBankTransactionCode": {
"__CLASS__": "Genkgo\\Camt\\DTO\\BankTransactionCode",
"getDomain": null,
"getProprietary": null
},
"getCharges": null,
"getReference": {
"__CLASS__": "Genkgo\\Camt\\DTO\\Reference",
"getAccountOwnerTransactionId": null,
"getAccountServicerReference": null,
"getAccountServicerTransactionId": null,
"getChequeNumber": null,
"getClearingSystemReference": null,
"getEndToEndId": null,
"getInstructionId": null,
"getMandateId": null,
"getMarketInfrastructureTransactionId": null,
"getMessageId": null,
"getPaymentInformationId": null,
"getProcessingId": null,
"getProprietaries": [],
"getTransactionId": null,
"getUuidEndToEndReference": "255ae394-9965-4438-ac86-f406feada396"
},
"getRelatedAgent": null,
"getRelatedAgents": [],
"getRelatedDates": null,
"getRelatedParties": [],
"getRelatedParty": null,
"getRemittanceInformation": null,
"getReturnInformation": null
},
"getTransactionDetails": [
"__RECURSIVITY__"
],
"getValueDate": null
}
],
"getGroupHeader": {
"__CLASS__": "Genkgo\\Camt\\Camt054\\DTO\\V04\\GroupHeader",
"getAdditionalInformation": null,
"getCreatedOn": {
"__CLASS__": "DateTimeImmutable",
"0": "2007-10-18T11:30:00+00:00"
},
"getMessageId": "AAAASESS-FP-ACCR001",
"getMessageRecipient": null,
"getOriginalBusinessQuery": null,
"getPagination": null
},
"getRecords": [
"__RECURSIVITY__"
]
}
34 changes: 34 additions & 0 deletions test/data/camt054.v8-with-UETR.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.054.001.08" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:camt.054.001.08 camt.054.001.08.xsd">
<BkToCstmrDbtCdtNtfctn>
<GrpHdr>
<MsgId>AAAASESS-FP-ACCR001</MsgId>
<CreDtTm>2007-10-18T12:30:00+01:00</CreDtTm>
</GrpHdr>
<Ntfctn>
<Id>AAAASESS-FP-ACCR001</Id>
<CreDtTm>2007-10-18T12:30:00+01:00</CreDtTm>
<Acct>
<Id>
<IBAN>CH2801234000123456789</IBAN>
</Id>
</Acct>
<Ntry>
<Amt Ccy="SEK">200000</Amt>
<CdtDbtInd>DBIT</CdtDbtInd>
<Sts>
<Cd>BOOK</Cd>
</Sts>
<BkTxCd>
</BkTxCd>
<NtryDtls>
<TxDtls>
<Refs>
<UETR>255ae394-9965-4438-ac86-f406feada396</UETR>
</Refs>
</TxDtls>
</NtryDtls>
</Ntry>
</Ntfctn>
</BkToCstmrDbtCdtNtfctn>
</Document>
9 changes: 6 additions & 3 deletions test/data/camt054.v8.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@
"getPaymentInformationId": "UXC06170000006PI00001",
"getProcessingId": null,
"getProprietaries": [],
"getTransactionId": null
"getTransactionId": null,
"getUuidEndToEndReference": null
},
"getRelatedAgent": {
"__CLASS__": "Genkgo\\Camt\\DTO\\RelatedAgent",
Expand Down Expand Up @@ -276,7 +277,8 @@
"getPaymentInformationId": "UXC06170000006PI00001",
"getProcessingId": null,
"getProprietaries": [],
"getTransactionId": null
"getTransactionId": null,
"getUuidEndToEndReference": null
},
"getRelatedAgent": {
"__CLASS__": "Genkgo\\Camt\\DTO\\RelatedAgent",
Expand Down Expand Up @@ -418,7 +420,8 @@
"getPaymentInformationId": "UXC06170000006PI00001",
"getProcessingId": null,
"getProprietaries": [],
"getTransactionId": null
"getTransactionId": null,
"getUuidEndToEndReference": null
},
"getRelatedAgent": {
"__CLASS__": "Genkgo\\Camt\\DTO\\RelatedAgent",
Expand Down

0 comments on commit 51c1533

Please sign in to comment.