A gem to find out issuer of the credit card just by entering the Card Number. Currently supports..
Add this line to your application's Gemfile:
gem 'cc_issuer'
And then execute:
$ bundle install
OR install it yourself as:
$ gem install cc_issuer
require 'cc_issuer'
'4444 4444 4444 4444'.cci? # => Visa
Where, 4444 4444 4444 4444 is to be replaced by your Card Number
require 'cc_issuer'
'4444444444444444'.cci? # => Visa
require 'cc_issuer'
'4444-4444-4444-4444'.cci? # => Visa
Where, cci?
refers to Credit Card Issuer?
Card Issuer | Key Value |
---|---|
Mastercard | :mastercard? |
Visa | :visa? |
Discover | :discover? |
American Express | :amex? |
Japan credit bureau | :jcb? |
Maestro | :maestro? |
DC Carte Blanche | :dccb? |
DC International | :dci? |
Enroute | :enroute? |
require 'cc_issuer'
'4444-4444-4444-4444'.visa? # => true
require 'cc_issuer'
'4444-4444-4444-4444'.maestro? # => false
Where, 4444-4444-4444-4444 is to be replaced by your Card Number
The gem is available as open source under the terms of the MIT License.