KontoCheck

Check whether a certain bic/account-no-combination can possibly be valid for a German bank, retrieve certain infos from the blz file and search for banks matching different criteria, convert bic/account into IBAN and BIC, test IBAN or BIC

It uses the C library konto_check available at sourceforge by Michael Plugge.

A few Examples

An example tends to tell more than a 1000 words:


>> require "konto_check"
true

# initialize the library
>> KontoCheck::init
1

# use UTF-8 encoding
>> KontoCheck::encoding 'u'
2

# check a bic/account combination
>> KontoCheck::konto_check("52250030","52001")
true

# retrieve a bank name
>> KontoCheck::bank_name("10010010")
"Postbank"

# search banks with "eifel"
>> eifel=KontoCheckRaw::bank_suche_volltext 'eifel'
[["Eifel"],
 [37069303, 37069342, 37069642, 37069720, 39050000, 39550110, 57069067, 57069144, 57650010, 57751310, 57761591, 58650030, 58651240, 58660101, 58661901, 58668818, 58691500, 58751230, 58760954],
 [2, 0, 1, 0, 6, 14, 2, 2, 1, 13, 18, 6, 2, 2, 1, 0, 0, 0, 1],
 1, 19]
# show some resuts
>> b=eifel[1]; f=eifel[2]; maxidx=eifel[4]-1
>> (10..maxidx).each{|i|  printf("%s (Fil.%2d) %s, %s\n",b[i],f[i],KontoCheck::bank_name(b[i],f[i]),KontoCheck::bank_ort(b[i],f[i])) }
57761591 (Fil.18) Volksbank RheinAhrEifel, Uersfeld, Eifel
58650030 (Fil. 6) Kreissparkasse Bitburg-Pr

Data file

To use the library, you need (of course) the current Bank Data. KontoCheck uses an own compressed format to hold the bank data distributed by the Deutsche Bundesbank. You can generate the file yourself using the function KontoCheck::generate_lutfile() or use the file from SourceForge.net. For further information have look at this page.

License

Since the original is licensed under LGPL, so is this module.