Skip to content
This repository has been archived by the owner on Jan 10, 2018. It is now read-only.

Commit

Permalink
[breaking] Remove 'elo' card type.
Browse files Browse the repository at this point in the history
Elo is an important local brand. However, the bin ranges are very
scattered, and it impossible with our current implementation to have
both comprehensive coverage and a bin pattern list that is not overly
long.

Users who need Elo can always extend `$.payment.cards`.
  • Loading branch information
jenan-stripe committed Sep 27, 2016
1 parent c5937df commit d0f4546
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 60 deletions.
7 changes: 0 additions & 7 deletions lib/jquery.payment.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/jquery.payment.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 0 additions & 30 deletions src/jquery.payment.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,6 @@ $.fn.payment = (method, args...) ->
defaultFormat = /(\d{1,4})/g

$.payment.cards = cards = [
# Elo has a lot of bins scattered throughout bin-space. Some are one-off, and
# some are large ranges. We include the full one-offs here and some range
# prefixes.
{
type: 'elo'
patterns: [
401178,
401179,
431274,
438935,
451416,
457393,
457631,
457632,
504175,
506699,
5067,
509,
627780,
636297,
636368,
650,
6516,
6550,
]
format: defaultFormat
length: [16]
cvcLength: [3]
luhn: true
}
{
type: 'maestro'
patterns: [
Expand Down
22 changes: 0 additions & 22 deletions test/specs.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ describe 'jquery.payment', ->
assert($.payment.validateCardNumber('3530111333300000'), 'jcb')
assert($.payment.validateCardNumber('3566002020360505'), 'jcb')

assert($.payment.validateCardNumber('6362970000457013'), 'elo')
assert($.payment.validateCardNumber('5066991111111118'), 'elo')

describe 'Validating a CVC', ->
it 'should fail if is empty', ->
topic = $.payment.validateCardCVC ''
Expand Down Expand Up @@ -201,11 +198,6 @@ describe 'jquery.payment', ->
topic = $.payment.cardType '4012121212121212'
assert.equal topic, 'visa'

# This was a regression from an overly-aggressive Elo prefix.
it 'should return Visa that begins with 4514', ->
topic = $.payment.cardType '4514'
assert.equal topic, 'visa'

it 'that begins with 2 should return MasterCard', ->
topic = $.payment.cardType '2221000002222221'
assert.equal topic, 'mastercard'
Expand All @@ -218,18 +210,6 @@ describe 'jquery.payment', ->
topic = $.payment.cardType '3412121212121212'
assert.equal topic, 'amex'

it 'that begins with 457393 should return Elo', ->
topic = $.payment.cardType '4573931212121212'
assert.equal topic, 'elo'

it 'that begins with 431274 should return Elo', ->
topic = $.payment.cardType '4312740000000000'
assert.equal topic, 'elo'

it 'that begins with 650031 should return Elo', ->
topic = $.payment.cardType '6500310000000000'
assert.equal topic, 'elo'

it 'that is not numbers should return null', ->
topic = $.payment.cardType 'aoeu'
assert.equal topic, null
Expand Down Expand Up @@ -276,8 +256,6 @@ describe 'jquery.payment', ->
assert.equal($.payment.cardType('3530111333300000'), 'jcb')
assert.equal($.payment.cardType('3566002020360505'), 'jcb')

assert.equal($.payment.cardType('6363689826438453'), 'elo')

describe 'Extending the card collection', ->
it 'should expose an array of standard card types', ->
cards = $.payment.cards
Expand Down

0 comments on commit d0f4546

Please sign in to comment.