Incorrect type
gabrielozaki opened this issue · comments
General information
- Library version: 8.3.0
- Browser and OS: Running on a Ubuntu 19.10 with Nodejs 12.16.1
Issue description
I have this test bin: "504175" and it's a ELO, confirmed by ccbins, freebinchecker, bincodes and the legacy system that i was working.
But I'm getting a Maestro result:
const creditCardType = require('credit-card-type');
const eloCard = creditCardType('504175');
console.log(eloCard);
Output:
[ { niceType: 'Maestro',
type: 'maestro',
patterns: [ 493698, [Array], [Array], [Array], 63, 67, 6 ],
gaps: [ 4, 8, 12 ],
lengths: [ 12, 13, 14, 15, 16, 17, 18, 19 ],
code: { name: 'CVC', size: 3 },
matchStrength: 6 } ]
There any place where i can get a updated bin table and make a PR to correct this issue?
Was able to reproduce this.
504175
is listed as an elo card number:
credit-card-type/lib/card-types.js
Line 163 in 401f821
So it's likely that the maestro ranges need to be updated to accommodate it. Right now, maestro is showing a an identical match strength for 504175
with ELO, and since it has a higher preference in the card test order, it's getting displayed.
Should be as simple as changing this line:
credit-card-type/lib/card-types.js
Line 137 in 401f821
Maestro will need to split that line into 2 ranges:
[500000, 504174],
// 504175 is confirmed to be only ELO cards
[504176, 506698],
Note: we're in the process of migrating this lib to Typescript, so we're unlikely to merge in any changes until that PR is complete.
Hi,
I will close the issue util the Typescript migration is complete
Thank you for your time and attention 😄
Gabriel Ozaki
I'm going to leave this open so we can better track it.
Typescript migration is complete.
Pull Request created #111
This was released as part of v9.0.1