Incorrect type
See original GitHub issueGeneral 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?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Salesforce Error: "ID Value of Incorrect Type"
Introduction. If you are receiving the Salesforce Error "ID Value of Incorrect Type" this means that an ID being sent to Salesforce is...
Read more >id value of incorrect type - apex - Salesforce Stack Exchange
We get this Malformed ID exception when you try to update the parent recordID on a child record. Here you are not passing...
Read more >id value of incorrect type" on record assignment to queues
When a record is assigned to a queue using flow and Process Builder, users will encounter an error about the incorrect ID type...
Read more >Incorrect type warning in PyCharm - python - Stack Overflow
Now I have some type warnings in the constructor of SpeficRepository . Expected type 'Union[BaseModel, Any]' (matched generic type 'T'), got ' ...
Read more >CWE-704: Incorrect Type Conversion or Cast (4.9) - MITRE
CWE-704: Incorrect Type Conversion or Cast ; ChildOf, Pillar - a weakness that is the most abstract type of weakness and represents a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m going to leave this open so we can better track it.
Was able to reproduce this.
504175
is listed as an elo card number: https://github.com/braintree/credit-card-type/blob/401f82161e630beec72903370313898230e25cbc/lib/card-types.js#L163So 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: https://github.com/braintree/credit-card-type/blob/401f82161e630beec72903370313898230e25cbc/lib/card-types.js#L137
Maestro will need to split that line into 2 ranges:
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.