Skip to content

Commit

Permalink
fix(ello): do not incorrectly identify cards as ELO
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepollak committed Sep 19, 2016
1 parent 5988182 commit 69ea7e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions spec/index.spec.coffee
Expand Up @@ -223,6 +223,10 @@ describe 'payment', ->
topic = Payment.fns.cardType '4573931212121212'
assert.equal topic, 'elo'

it 'should not miscategorize cards with 5067 in them as elo', ->
topic = Payment.fns.cardType '4012506712121212'
assert.equal topic, 'visa'

it 'that is not numbers should return null', ->
topic = Payment.fns.cardType 'aoeu'
assert.equal topic, null
Expand Down
2 changes: 1 addition & 1 deletion src/index.coffee
Expand Up @@ -86,7 +86,7 @@ cards = [
}
{
type: 'elo'
pattern: /^4011|438935|45(1416|76|7393)|50(4175|6699|67|90[4-7])|63(6297|6368)/,
pattern: /^(4011|438935|45(1416|76|7393)|50(4175|6699|67|90[4-7])|63(6297|6368))/,
format: defaultFormat
length: [16]
cvcLength: [3]
Expand Down

0 comments on commit 69ea7e0

Please sign in to comment.