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

Commit

Permalink
Merge pull request #223 from stripe/jenan-elo-update-bins
Browse files Browse the repository at this point in the history
Update Elo bins (#222 redux)
  • Loading branch information
jenanwise committed May 3, 2016
2 parents 0ff55d3 + f3a4bc0 commit 06e94c2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion 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.

5 changes: 3 additions & 2 deletions src/jquery.payment.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ $.payment.cards = cards = [
{
type: 'elo'
patterns: [
4011, 438935, 451416, 4576, 457393, 504175, 506699,
5067, 50904, 50905, 50906, 50907, 636297, 636368
4011, 4312, 4389, 4514, 4573, 4576,
5041, 5066, 5067, 509,
6277, 6362, 6363, 650, 6516, 6550
]
format: defaultFormat
length: [16]
Expand Down
9 changes: 8 additions & 1 deletion test/specs.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,14 @@ describe 'jquery.payment', ->
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 @@ -268,7 +276,6 @@ describe 'jquery.payment', ->
assert.equal($.payment.cardType('3566002020360505'), 'jcb')

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

describe 'Extending the card collection', ->
it 'should expose an array of standard card types', ->
Expand Down

0 comments on commit 06e94c2

Please sign in to comment.