raphaelm / python-sepaxml

SEPA Direct Debit XML generation in python
MIT License
112 stars 43 forks source link

Sparkasse compatibility #29

Open saddy001 opened 4 years ago

saddy001 commented 4 years ago

I had to do the following modifications to make it compatible with Sparkasse:

xml = re.sub(r'<PmtInfId>.+</PmtInfId>', '<PmtInfId>NOTPROVIDED</PmtInfId>', xml)
xml = re.sub(r'.+<PmtTpInf>[\S\n ]+?</PmtTpInf>\n', '', xml)
xml = re.sub(r'.+<CdtrAgt>[\S\n ]+?</CdtrAgt>\n', '', xml)
xml = re.sub(r'.+<BtchBookg>[\S\n ]+?</BtchBookg>\n', '', xml)

Maybe these could be options for python-sepaxml.

raphaelm commented 3 years ago

Sorry for the late reply.

We're not going to add some arbitrary regexes, but if there's a way we can fix this structurally, we are happy to. Can you tell me which PAIN version you used and whether you tried with debits or transfers?

saddy001 commented 3 years ago

We're not going to add some arbitrary regexes

Sure, that was also my request.

but if there's a way we can fix this structurally

Here are the changes from above:

  1. Replace PmtInfId data with "NOTPROVIDED"
  2. Remove PmtTpInf tag
  3. Remove CdtrAgt tag
  4. Remove BtchBookg tag

Can you tell me which PAIN version you used and whether you tried with debits or transfers?

pain.001.001.03

guettli commented 3 years ago

I had to do the following modifications to make it compatible with Sparkasse:

xml = re.sub(r'<PmtInfId>.+</PmtInfId>', '<PmtInfId>NOTPROVIDED</PmtInfId>', xml)
xml = re.sub(r'.+<PmtTpInf>[\S\n ]+?</PmtTpInf>\n', '', xml)
xml = re.sub(r'.+<CdtrAgt>[\S\n ]+?</CdtrAgt>\n', '', xml)
xml = re.sub(r'.+<BtchBookg>[\S\n ]+?</BtchBookg>\n', '', xml)

Maybe these could be options for python-sepaxml.

The regex [\S\n ] looks broken. \S means non-space. I guess you mean \s