mdomke / schwifty

IBAN parsing and validation
https://schwifty.readthedocs.io
MIT License
206 stars 80 forks source link

Turkish IBAN - Branch is empty string? #38

Open Ghost93 opened 3 years ago

Ghost93 commented 3 years ago

Hi Thanks for this library, it really helps :smiley: (and it has a nice name)

I have a problem regarding Turkey. Whenever I parse a Turkish IBAN the branch code is an empty string. I looked at the code and it seems like the branch part the start index and end index is the same - link to relevant part in json file.

Here's an example of a site that can decode the branch part given a Turkish IBAN - link.

Any ideas how I can achieve this decoding of the branch part as well using schwifty?

Thanks

mdomke commented 3 years ago

Hello @Ghost93,

thank you for the issue report. I tried to use the validator you linked with an example IBAN from iban.com (TR320010009999901234567890), but couldn't find the branch information in the output. Which part specifically is supposed to be the branch identifier? When looking at the official IBAN registry, the branch identifier position within the BBAN is not provided for turkish IBANs. Also wikipedia does not indicate at which position a branch identifier could be located. Please let me know if you can give me more specific information about how the parsing result should look instead!

Ghost93 commented 3 years ago

Hi @mdomke You're correct, the validator I gave can identify good or bad IBAN values, and can identify the branch if its in the IBAN. Take TR470006200157200006299246 for instance. The result is:

BANKA BİLGİLERİ
Ad: GARANTİ BANKASI
Kod: 0062
Swift: TGBATRIS
Hesap No: 6299246

ŞUBE BİLGİLERİ
Ad: Şubesi
Kod: 1572
İl:
İlçe:
Tel: 0
Fax: 0
Adres:

First part is bank information, Second part is the branch information.

Ghost93 commented 3 years ago

Here's another link that explains how to decode the branch code from the IBAN.

Ghost93 commented 3 years ago

@mdomke In the meantime I created a fork of your repository with the relevant change for my specific use case. It's not the best solution - I just changed the generated file with the relevant indices. You can see it here - link.

mdomke commented 8 months ago

Hej @Ghost93, from the link you provided I got the picture below

image

Would you mind explaining what the different sections mean? "SUBE KODU" is "Branch Code", "MÜSTERI NO" is "Customer Number" and "HESAP EK NO" is "Account Number" 🤷🏻‍♂️ ?

Edit: Sorry. I just realized that this issue is 2 years old, so this is rather a long shot to get a response from you 😅