Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for camt.054 / document type autodetection / minor updates/fixes #6

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

MarcoSteinacher
Copy link

We've been using the library for a while now for camt.053 files. Now we needed support for camt.054, which I have added here. Along the way we also added auto-detection of the document type and updated/fixed a few other things to make it work for our documents (Swiss banks).

Major changes:

  • Added support for camt.054 (bank_to_customer_debit_credit_notification)
  • Auto-detection of document type from xml namespace: If parse() is called with structure=None, the matching structure is selected automatically based on the xmlns attribute of the document and the standard and compatible_standards attributes of the sepa_messages objects. If no matching structure is found, the UnsupportedDocumentType exception is raised. The document type is returned as document_type in the data.
  • Better support for 2019 versions of camt (v08): Added party_compat(), which should make the parser compatible with v06 and v08 documents. Added end_to_end_uuid.

Minor changes:

  • Added 'Ownr' to account()
  • Added 'AddtlInf' to statement_group_header()
  • Implemented structure for 'Chrgs' in charges()
  • Implemented structure for 'Strd' in entry() [remittance_information]
  • Use etree.QName(tree).localname to get the tag name without the xmlns prefix.
  • Fixed typos: 'ClrSysMmdId' > 'ClrSysMmbId', 'AddtInf' > 'AddtlInf'
  • Added schemas for v04 and v08 of camt.053 and camt.054

I would be happy to contribute those changes to the main repository.

Note: It is not clear to me what the best way to support multiple versions of a document type (e.g. camt.053.06 and camt.053.08) at the same time. Currently it seems to works, but it doesn't seem to be very clean or consistent. Is there a strategy to address that in the future?

- Added support for camt.053 (BankToCustomerDebitCreditNotification)
- Some updates to support 2019 versions of camt (v08).
- Automatically detect document type from XML namespace.
- Addes schemas for camt.053.001.08, camt.054.001.04, and camt.054.001.08
@DanielleHuisman
Copy link
Member

Thanks for your contribution. We don't actively use this project anymore, but I'll take a look at this PR next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants