question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
crookedneighborcommented, May 11, 2020

I’m going to leave this open so we can better track it.

1reaction
crookedneighborcommented, May 8, 2020

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#L163

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: https://github.com/braintree/credit-card-type/blob/401f82161e630beec72903370313898230e25cbc/lib/card-types.js#L137

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found