Bin numbers used by Turkish Banks. You can query by bin number and get info (bank name, credit card type, etc.) or you can query by bank and card type and get list of bins.
The only requirement is a working Ruby installation.
Add it to your Gemfile:
gem 'turkish_bin_numbers'
and run on terminal:
$ bundle
or install the gem on terminal.
$ gem install turkish_bin_numbers
Get info by bin number
TurkishBinNumbers.get(418342)
# => {"bin_number"=>418342, "bank_id"=>24, "bank_name"=>"Türkiye İş Bankası", "bin_type"=>"credit_card", "card_type"=>"Visa"}
Get bin numbers by bank name
TurkishBinNumbers.bins_of_bank("Ziraat Bankası")
# => [454672, 444678, 444676, ...]
Get bank list
TurkishBinNumbers.banks
# => ["ABank", "Akbank", "Aktifbank", ...]
Get bin numbers for non-debit credit cards
TurkishBinNumbers.credit_card_bins
# => [466283, 516458, 522221, ...]
Get bin numbers for debit credit cards
TurkishBinNumbers.debit_card_bins
# => [627768, 466284, 670670, ...]
Get card type of bin number (Visa, MasterCard, American Express, Maestro)
TurkishBinNumbers.detect_card_type(418342)
# => "Visa"
- Fork it ( https://github.com/tgezginis/turkish_bin_numbers/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Thanks