Low commit activity in last 3 years
No release in over a year
Find credit card information by BIN/IIN
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 12.3.3
~> 3.7
~> 6.1.0
~> 3.13

Runtime

 Project Readme

CreditCardFinder

This gem allows you to find some credit card information by BIN/IIN code. Now it uses two strategies for search. First strategy use 'credit_card_bins' gem and provide search in YAML files. Second strategy use bincodes.com API (so you will need register and get api key).

Installation

Add this line to your application's Gemfile:

gem 'credit_card_finder'

And then execute:

$ bundle

Or install it yourself as:

$ gem install credit_card_finder

Configuration

CreditCardFinder::Config.configure do |config|
    config.bincodes.api_key = 'your_api_key'
    
    # set timeout for api request
    config.bincodes.timeout = 10 # already set by default
    
    # alredy set by default
    config.strategies = %w[CreditCardBinsStrategy BincodesStrategy]
    
    # also you can use custom logger instance
    config.logger = Logger.new(STDOUT)
end

Usage

If you want use strategies for search, you just need make call:

bin = '427664'
CreditCardFinder.lookup(bin)

By default that call will be search firstly in YAML files via credit_card_bins gem, and if find nothing, will search via bincodes.com.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/serverscom/credit-card-finder. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the CreditCardFinder project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.