Skip to content

Commit

Permalink
[12.0][IMP] - support Camt 053 in account_payment_return_import_iso20022
Browse files Browse the repository at this point in the history
  • Loading branch information
sbejaoui committed May 18, 2020
1 parent 6c3c3d5 commit e7d3c97
Show file tree
Hide file tree
Showing 6 changed files with 253 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
* David Vidal <[email protected]>
* Luis M. Ontalba <[email protected]>
* Thomas Binsfeld <[email protected]>
* Souheil Bejaoui <[email protected]>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Module to import payment returns from pain.002.001.03 and camt.054.001.02 files.
Module to import payment returns from pain.002.001.03, camt.053.001.02 and camt.054.001.02 files.
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.053.001.02">
<BkToCstmrStmt>
<GrpHdr>
<MsgId>MSGID99345678912</MsgId>
<CreDtTm>2016-10-08T20:49:00</CreDtTm>
</GrpHdr>
<Stmt>
<Id>ZY08XXXXXXIS634C</Id>
<CreDtTm>2016-10-08T20:49:00</CreDtTm>
<Acct>
<Id>
<IBAN>NL77ABNA0574908765</IBAN>
</Id>
<Ccy>EUR</Ccy>
<Svcr>
<FinInstnId>
<BIC>BOFIIE2D</BIC>
</FinInstnId>
</Svcr>
</Acct>
<TxsSummry>
<TtlCdtNtries>
<NbOfNtries>0</NbOfNtries>
<Sum>0.00</Sum>
</TtlCdtNtries>
<TtlDbtNtries>
<NbOfNtries>1</NbOfNtries>
<Sum>100</Sum>
</TtlDbtNtries>
</TxsSummry>
<Ntry>
<Amt Ccy="EUR">100.00</Amt>
<CdtDbtInd>DBIT</CdtDbtInd>
<Sts>BOOK</Sts>
<BookgDt>
<Dt>2016-10-08</Dt>
</BookgDt>
<BkTxCd>
<Domn>
<Cd>PMNT</Cd>
<Fmly>
<Cd>IDDT</Cd>
<SubFmlyCd>UPDD</SubFmlyCd>
</Fmly>
</Domn>
<Prtry>
<Cd>B3/0811</Cd>
</Prtry>
</BkTxCd>
<NtryDtls>
<TxDtls>
<Refs>
<InstrId>FA031615104</InstrId>
<EndToEndId>E2EID1</EndToEndId>
<MndtId>MANDATEID2</MndtId>
</Refs>
<AmtDtls>
<TxAmt>
<Amt Ccy="EUR">100.00</Amt>
</TxAmt>
</AmtDtls>
<RltdPties>
<Dbtr>
<Nm>DEBTOR4</Nm>
</Dbtr>
<DbtrAcct>
<Id>
<IBAN>IE16AIBK93110187654321</IBAN>
</Id>
</DbtrAcct>
<Cdtr>
<Nm>CREDITOR</Nm>
<Id>
<PrvtId>
<Othr>
<Id>IE03ZZZ123456</Id>
<SchmeNm>
<Prtry>SEPA</Prtry>
</SchmeNm>
</Othr>
</PrvtId>
</Id>
</Cdtr>
</RltdPties>
<RmtInf>
<Ustrd>FACTURE DU 15.03.16</Ustrd>
</RmtInf>
<RltdDts>
<IntrBkSttlmDt>2016-10-09</IntrBkSttlmDt>
</RltdDts>
<RtrInf>
<Orgtr>
<Id>
<OrgId>
<BICOrBEI>BOFIIE2D</BICOrBEI>
</OrgId>
</Id>
</Orgtr>
<Rsn>
<Cd>AC06</Cd>
</Rsn>
<AddtlInf>/RTYP/RTRN</AddtlInf>
</RtrInf>
<AddtlTxInf>/SQTP/RCUR/DTOFSGNT/2013-11-14</AddtlTxInf>
</TxDtls>
</NtryDtls>
</Ntry>
</Stmt>
</BkToCstmrStmt>
</Document>
Original file line number Diff line number Diff line change
@@ -1,111 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.054.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<BkToCstmrDbtCdtNtfctn>
<GrpHdr>
<MsgId>MSGID99345678912</MsgId>
<CreDtTm>2016-10-08T20:49:00</CreDtTm>
</GrpHdr>
<Ntfctn>
<Id>ZY08XXXXXXIS634C</Id>
<CreDtTm>2016-10-08T20:49:00</CreDtTm>
<Acct>
<Id>
<IBAN>NL77ABNA0574908765</IBAN>
</Id>
<Ccy>EUR</Ccy>
<Svcr>
<FinInstnId>
<BIC>BOFIIE2D</BIC>
</FinInstnId>
</Svcr>
</Acct>
<TxsSummry>
<TtlCdtNtries>
<NbOfNtries>0</NbOfNtries>
<Sum>0.00</Sum>
</TtlCdtNtries>
<TtlDbtNtries>
<NbOfNtries>1</NbOfNtries>
<Sum>100</Sum>
</TtlDbtNtries>
</TxsSummry>
<Ntry>
<Amt Ccy="EUR">100.00</Amt>
<CdtDbtInd>DBIT</CdtDbtInd>
<Sts>BOOK</Sts>
<BookgDt>
<Dt>2016-10-08</Dt>
</BookgDt>
<BkTxCd>
<Domn>
<Cd>PMNT</Cd>
<Fmly>
<Cd>IDDT</Cd>
<SubFmlyCd>UPDD</SubFmlyCd>
</Fmly>
</Domn>
<Prtry>
<Cd>B3/0811</Cd>
</Prtry>
</BkTxCd>
<NtryDtls>
<TxDtls>
<Refs>
<InstrId>FA031615104</InstrId>
<EndToEndId>E2EID1</EndToEndId>
<MndtId>MANDATEID2</MndtId>
</Refs>
<AmtDtls>
<InstdAmt>
<Amt Ccy="EUR">100.00</Amt>
</InstdAmt>
</AmtDtls>
<RltdPties>
<Dbtr>
<Nm>DEBTOR4</Nm>
</Dbtr>
<DbtrAcct>
<Id>
<IBAN>IE16AIBK93110187654321</IBAN>
</Id>
</DbtrAcct>
<Cdtr>
<Nm>CREDITOR</Nm>
<Id>
<PrvtId>
<Othr>
<Id>IE03ZZZ123456</Id>
<SchmeNm>
<Prtry>SEPA</Prtry>
</SchmeNm>
</Othr>
</PrvtId>
</Id>
</Cdtr>
</RltdPties>
<RmtInf>
<Ustrd>FACTURE DU 15.03.16</Ustrd>
</RmtInf>
<RltdDts>
<IntrBkSttlmDt>2016-10-09</IntrBkSttlmDt>
</RltdDts>
<RtrInf>
<Orgtr>
<Id>
<OrgId>
<BICOrBEI>BOFIIE2D</BICOrBEI>
</OrgId>
</Id>
</Orgtr>
<Rsn>
<Cd>AC06</Cd>
</Rsn>
<AddtlInf>/RTYP/RTRN</AddtlInf>
</RtrInf>
<AddtlTxInf>/SQTP/RCUR/DTOFSGNT/2013-11-14</AddtlTxInf>
</TxDtls>
</NtryDtls>
</Ntry>
</Ntfctn>
</BkToCstmrDbtCdtNtfctn>
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.054.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<BkToCstmrDbtCdtNtfctn>
<GrpHdr>
<MsgId>MSGID99345678912</MsgId>
<CreDtTm>2016-10-08T20:49:00</CreDtTm>
</GrpHdr>
<Ntfctn>
<Id>ZY08XXXXXXIS634C</Id>
<CreDtTm>2016-10-08T20:49:00</CreDtTm>
<Acct>
<Id>
<IBAN>NL77ABNA0574908765</IBAN>
</Id>
<Ccy>EUR</Ccy>
<Svcr>
<FinInstnId>
<BIC>BOFIIE2D</BIC>
</FinInstnId>
</Svcr>
</Acct>
<TxsSummry>
<TtlCdtNtries>
<NbOfNtries>0</NbOfNtries>
<Sum>0.00</Sum>
</TtlCdtNtries>
<TtlDbtNtries>
<NbOfNtries>1</NbOfNtries>
<Sum>100</Sum>
</TtlDbtNtries>
</TxsSummry>
<Ntry>
<Amt Ccy="EUR">100.00</Amt>
<CdtDbtInd>DBIT</CdtDbtInd>
<Sts>BOOK</Sts>
<BookgDt>
<Dt>2016-10-08</Dt>
</BookgDt>
<BkTxCd>
<Domn>
<Cd>PMNT</Cd>
<Fmly>
<Cd>IDDT</Cd>
<SubFmlyCd>UPDD</SubFmlyCd>
</Fmly>
</Domn>
<Prtry>
<Cd>B3/0811</Cd>
</Prtry>
</BkTxCd>
<NtryDtls>
<TxDtls>
<Refs>
<InstrId>FA031615104</InstrId>
<EndToEndId>E2EID1</EndToEndId>
<MndtId>MANDATEID2</MndtId>
</Refs>
<AmtDtls>
<InstdAmt>
<Amt Ccy="EUR">100.00</Amt>
</InstdAmt>
</AmtDtls>
<RltdPties>
<Dbtr>
<Nm>DEBTOR4</Nm>
</Dbtr>
<DbtrAcct>
<Id>
<IBAN>IE16AIBK93110187654321</IBAN>
</Id>
</DbtrAcct>
<Cdtr>
<Nm>CREDITOR</Nm>
<Id>
<PrvtId>
<Othr>
<Id>IE03ZZZ123456</Id>
<SchmeNm>
<Prtry>SEPA</Prtry>
</SchmeNm>
</Othr>
</PrvtId>
</Id>
</Cdtr>
</RltdPties>
<RmtInf>
<Ustrd>FACTURE DU 15.03.16</Ustrd>
</RmtInf>
<RltdDts>
<IntrBkSttlmDt>2016-10-09</IntrBkSttlmDt>
</RltdDts>
<RtrInf>
<Orgtr>
<Id>
<OrgId>
<BICOrBEI>BOFIIE2D</BICOrBEI>
</OrgId>
</Id>
</Orgtr>
<Rsn>
<Cd>AC06</Cd>
</Rsn>
<AddtlInf>/RTYP/RTRN</AddtlInf>
</RtrInf>
<AddtlTxInf>/SQTP/RCUR/DTOFSGNT/2013-11-14</AddtlTxInf>
</TxDtls>
</NtryDtls>
</Ntry>
</Ntfctn>
</BkToCstmrDbtCdtNtfctn>
</Document>
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_zip_import_pain(self):
date='2016-10-08'
)

def test_payment_return_import_camt(self):
def test_payment_return_import_camt_053(self):
"""Test correct creation of single payment return."""
transactions = [
{
Expand All @@ -85,7 +85,24 @@ def test_payment_return_import_camt(self):
]
self._test_return_import(
'account_payment_return_import_iso20022',
'test-sepa-camt-unpaid.xml',
'test-sepa-camt-053-unpaid.xml',
'ZY08XXXXXXIS634C',
local_account='NL77ABNA0574908765',
date='2016-10-08', transactions=transactions
)

def test_payment_return_import_camt_054(self):
"""Test correct creation of single payment return."""
transactions = [
{
'returned_amount': 100.00,
'reference': 'E2EID1',
'reason_add_info': '/RTYP/RTRN',
},
]
self._test_return_import(
'account_payment_return_import_iso20022',
'test-sepa-camt-054-unpaid.xml',
'ZY08XXXXXXIS634C',
local_account='NL77ABNA0574908765',
date='2016-10-08', transactions=transactions
Expand Down
Loading

0 comments on commit e7d3c97

Please sign in to comment.