← Back to team overview

banking-addons-team team mailing list archive

[Merge] lp:~therp-nl/banking-addons/camt_stuzza into lp:banking-addons

 

Holger Brunn (Therp) has proposed merging lp:~therp-nl/banking-addons/camt_stuzza into lp:banking-addons.

Requested reviews:
  Banking Addons Core Editors (banking-addons-team)

For more details, see:
https://code.launchpad.net/~therp-nl/banking-addons/camt_stuzza/+merge/211952

I've been working on a camt53 statement provided by UniCredit Austria.

I encountered a weird namespace there and needed the following patch. See the first commit message for some details. The full namespace would be 'ISO:camt.053.001.02:APC:STUZZA:payments:003'.

Now I feel a bit uneasy about doing startswith heuristics. Why don't we whitelist namespaces we can work with?
-- 
https://code.launchpad.net/~therp-nl/banking-addons/camt_stuzza/+merge/211952
Your team Banking Addons Core Editors is requested to review the proposed merge of lp:~therp-nl/banking-addons/camt_stuzza into lp:banking-addons.
=== modified file 'account_banking_camt/camt.py'
--- account_banking_camt/camt.py	2013-10-11 12:20:14 +0000
+++ account_banking_camt/camt.py	2014-03-20 14:33:15 +0000
@@ -253,12 +253,14 @@
         """
         Sanity check the document's namespace
         """
-        if not self.ns.startswith('{urn:iso:std:iso:20022:tech:xsd:camt.'):
+        if not self.ns.startswith('{urn:iso:std:iso:20022:tech:xsd:camt.')\
+           and not self.ns.startswith('{ISO:camt.'):
             raise except_orm(
                 "Error",
                 "This does not seem to be a CAMT format bank statement.")
 
-        if not self.ns.startswith('{urn:iso:std:iso:20022:tech:xsd:camt.053.'):
+        if not self.ns.startswith('{urn:iso:std:iso:20022:tech:xsd:camt.053.')\
+           and not self.ns.startswith('{ISO:camt.053'):
             raise except_orm(
                 "Error",
                 "Only CAMT.053 is supported at the moment.")


References