Use the ActiveMerchant company specific credit card regexes

@ggrossman 

This makes it so we use Shipify's beautiful activemerchant gem.

Should I add tests for the `brand?` method?
They are all here  https://github.com/Shopify/active_merchant/blob/master/test/unit/credit_card_methods_test.rb
Just copy-paste their implementation, and maybe drop a comment to where it
can be copied again,
that should be easy enough to update and not require any dependency

On Mon, Oct 13, 2014 at 10:29 AM, Josh Lubaway <notifications@github.com>
wrote:

> In lib/credit_card_sanitizer.rb:
>
> > +  #   'visa'               => /^4\d{12}(\d{3})?$/,
> > +  #   'master'             => /^(5[1-5]\d{4}|677189)\d{10}$/,
> > +  #   'discover'           => /^(6011|65\d{2}|64[4-9]\d)\d{12}|(62\d{14})$/,
> > +  #   'american_express'   => /^3[47]\d{13}$/,
> > +  #   'diners_club'        => /^3(0[0-5]|[68]\d)\d{11}$/,
> > +  #   'jcb'                => /^35(28|29|[3-8]\d)\d{12}$/,
> > +  #   'switch'             => /^6759\d{12}(\d{2,3})?$/,
> > +  #   'solo'               => /^6767\d{12}(\d{2,3})?$/,
> > +  #   'dankort'            => /^5019\d{12}$/,
> > +  #   'maestro'            => /^(5[06-8]|6\d)\d{10,17}$/,
> > +  #   'forbrugsforeningen' => /^600722\d{10}$/,
> > +  #   'laser'              => /^(6304|6706|6709|6771(?!89))\d{8}(\d{4}|\d{6,7})?$/
> > +  # }
> > +
> > +  CARD_COMPANY_PREFIXES = [].tap do |lookup|
> > +    lookup[12] = %r(\A(?:
>
> The gem dependency thing is kind of a bummer, but the list is a pretty
> decent intersection with a standard Rails app activesupport, i18n, json,
> nokogiri.
>
> Maybe we can work with them to eliminate dependencies *within* the gem,
> like activesupport does. Then we could require *one* file and get only
> what we need:
>
> require 'active_merchant/billing/credit_card_methods'
>
> ?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/zendesk/credit_card_sanitizer/pull/16/files#r18782376>
> .
>