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

Incorrect domestic_bank_codes parsing Revolut BIC #242

Open
EvaSDK opened this issue Jan 30, 2025 · 1 comment
Open

Incorrect domestic_bank_codes parsing Revolut BIC #242

EvaSDK opened this issue Jan 30, 2025 · 1 comment

Comments

@EvaSDK
Copy link

EvaSDK commented Jan 30, 2025

I am trying to rebuild IBAN from partial information in bank transaction items in woob and I just hit a problem with a new statement line that just gives the bank_name when it was provided the bank code before. Since I have the BIC available, I was trying to use it to get bank the bank code, unfortunately, in this instance, the value that is returned is incorrect.

In [1]: from schwifty import BIC, IBAN

In [2]: b = BIC("REVOFRP2XXX")

In [3]: b.domestic_bank_codes
Out[3]: ['32501']

The expected result is:

In [4]: b = BIC("REVOFRP2")

In [5]: b.domestic_bank_codes
Out[5]: ['28233']

After checking the repository, I could find a bank_code entry matching 32501 in schwifty/bank_registry/generated_at.json and schwifty/bank_registry/generated_lt.json, so I guess there is an issue in how the registry is built but I haven't gone as far as trying to debug it.

@EvaSDK
Copy link
Author

EvaSDK commented Feb 3, 2025

To give a bit of context, I'm currently trying to match bank transaction statements with accounts to generate OFX file in woob project. The bank is generating 2 different types of label for the operation if the transfer is instant or not.

For normal (not instant) Euro-zone transfer, it looks like:

000001 VIR EUROPEEN EMIS LOGITEL POUR: John Doe 30 12 BQ 2823301234 CPT 00012345678 REF: 1234567890123 MOTIF: rent CHEZ: REVOFRP2

With, in order, bank blabber, beneficiary name, day, month, bank code, account it, transfer reference and motive and finally BIC.

But for instant transfer, using the same pre-registered beneficiary, it looks like:

000001 VIR INSTANTANE EMIS LOGITEL POUR: John Doe 30 12 BQ REVO CPT 00012345678 REF: 1234567890123 REF: 012345678900000001 MOTIF: rent CHEZ: REVOFRP2XXX

I initially wanted to use account id and bank code to match pre-registered beneficiary list, however, the instant transfer breaks that. So I was trying to recover the bank code from BIC but the association does not match the country. In some cases like with N26, it does not even exist in BIC registry (NTSBFRM1 vs. NTSBFRM1XXX).

I don't know if it is valid for a country to expose a BIC where the country code does not match but it sounds like it the Revolut entry should be moved to France registry. As for N26 french subsidiary, I have no clue what to do.

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

No branches or pull requests

1 participant