Sha256: 18ff5ab1bb9054fad1a876d6c1e2dc7ab6f6770a38030afde27621e511b9a3bd

Contents?: true

Size: 1.69 KB

Versions: 21

Compression:

Stored size: 1.69 KB

Contents

# == CreditCardValidations Mmi
#
# Implements Major Industry Identifier (MII) detection
#
# The first digit of a credit card number is the Major Industry Identifier (MII), which represents the category of entity which issued the card. MII digits represent the following issuer categories:
# 0 – ISO/TC 68 and other future industry assignments
# 1 – Airlines
# 2 – Airlines and other future industry assignments
# 3 – Travel and entertainment and banking/financial
# 4 – Banking and financial
# 5 – Banking and financial
# 6 – Merchandising and banking/financial
# 7 – Petroleum and other future industry assignments
# 8 – Healthcare, telecommunications and other future industry assignments
# 9 – National assignment
# For example, American Express, Diner's Club, Carte Blanche,
# and JCB are in the travel and entertainment category;
# VISA, MasterCard, and Discover are in the banking and financial category (Discover being in the Merchandising and banking/financial category);
# and Sun Oil and Exxon are in the petroleum category.


module CreditCardValidations
  module Mmi

    ISSUER_CATEGORIES = {
        '0' => 'ISO/TC 68 nd other industry assignments',
        '1' => 'Airlines',
        '2' => 'Airlines and other industry assignments',
        '3' => 'Travel and entertainment and banking/financial',
        '4' => 'Banking and financial',
        '5' => 'Banking and financial',
        '6' => 'Merchandising and banking/financial',
        '7' => 'Petroleum and other industry assignments',
        '8' => 'Healthcare, telecommunications and other industry assignments',
        '9' => 'National assignment'

    }

    def issuer_category
      ISSUER_CATEGORIES[@number.to_s[0]]
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
credit_card_validations-7.0.0 lib/credit_card_validations/mmi.rb
credit_card_validations-6.3.0 lib/credit_card_validations/mmi.rb
credit_card_validations-6.1.0 lib/credit_card_validations/mmi.rb
credit_card_validations-6.0.0 lib/credit_card_validations/mmi.rb
credit_card_validations-5.0.0 lib/credit_card_validations/mmi.rb
credit_card_validations-4.1.0 lib/credit_card_validations/mmi.rb
credit_card_validations-4.0.0 lib/credit_card_validations/mmi.rb
credit_card_validations-3.5.1 lib/credit_card_validations/mmi.rb
credit_card_validations-3.5.0 lib/credit_card_validations/mmi.rb
cw_credit_card_validations-3.4.2 lib/credit_card_validations/mmi.rb
cw_credit_card_validations-3.4.1 lib/credit_card_validations/mmi.rb
cw_credit_card_validations-3.4.0 lib/credit_card_validations/mmi.rb
credit_card_validations-3.4.0 lib/credit_card_validations/mmi.rb
credit_card_validations-3.3.0 lib/credit_card_validations/mmi.rb
credit_card_validations-3.2.2 lib/credit_card_validations/mmi.rb
credit_card_validations-3.2.1 lib/credit_card_validations/mmi.rb
credit_card_validations-3.1.0 lib/credit_card_validations/mmi.rb
credit_card_validations-3.0.0 lib/credit_card_validations/mmi.rb
credit_card_validations-2.0.2 lib/credit_card_validations/mmi.rb
credit_card_validations-2.0.1 lib/credit_card_validations/mmi.rb