python-sepaxml icon indicating copy to clipboard operation
python-sepaxml copied to clipboard

Broken FinInstnId

Open FrankKipf opened this issue 2 years ago • 10 comments

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

It should look like this:

<DrctDbtTxInf> ... <DbtrAgt> <FinInstnId> <Othr> <Id>NOTPROVIDED</Id> </Othr> </FinInstnId> </DbtrAgt> ... </DrctDbtTxInf>

But instead I receive that output:

<DrctDbtTxInf> ... <DbtrAgt> <FinInstnId/> </DbtrAgt> ... </DrctDbtTxInf>

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

FrankKipf avatar Feb 06 '24 20:02 FrankKipf

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..

Varchibald avatar May 02 '24 08:05 Varchibald

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

FrankKipf avatar May 02 '24 09:05 FrankKipf

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 avatar May 02 '24 09:05 Varchibald

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

Varchibald avatar May 02 '24 09:05 Varchibald

No, not reall

raphaelm avatar May 02 '24 10:05 raphaelm

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.

Varchibald avatar May 02 '24 14:05 Varchibald