raphaelm / python-sepaxml

SEPA Direct Debit XML generation in python
MIT License
110 stars 41 forks source link

Broken FinInstnId #61

Open FrankKipf opened 7 months ago

FrankKipf commented 7 months ago

Adding a payment without BIC leads to a broken <FinInstnId>

It should look like this:

` ...

NOTPROVIDED

... `

But instead I receive that output:

` ...

... `

I'm not sure, but I think in debit.py line 268 and line 269 have to be swapped with each other.

Varchibald commented 4 months ago

I have the same issue using pain.008.001.02.

I actually fixed it by removing the condition on line 345 in debit.py: elif self.schema != 'pain.008.001.02' and self.schema != 'pain.008.002.02'

Not sure why that was there in the first place..

FrankKipf commented 4 months ago

I added a BIC to each payment. If you don't have the BIC, take a look at openiban.com

Varchibald commented 4 months ago

I need BICs from a broader range of countries than what is supported by openiban, unfortunately. I edited my solution in previous answer, maybe I'll open a PR later.

Varchibald commented 4 months ago

@raphaelm do you know why this condition was put in there?

raphaelm commented 4 months ago

No, not reall

Varchibald commented 4 months ago

I assume the original merge @ https://github.com/raphaelm/python-sepaxml/pull/25 wanted the BIC-notprovided interaction only for their format (pain.008.003.02), so they excluded the other formats for fault of testing. Imo it shouldn't cause any issues if the exception is removed.