braintree / credit-card-type

A library for determining credit card type
MIT License
985 stars 154 forks source link

Wrong type: It's a Mastercard and it's outputting Maestro #140

Closed SrBrahma closed 2 years ago

SrBrahma commented 2 years ago

General information

Issue description

My Payment Gateway has the following Mastercard test card: 5031 4332 1540 6351, and this lib is wrongly informing it's a Maestro card.

Output:

[
  {
    niceType: 'Maestro',
    type: 'maestro',
    patterns: [
      493698,  [Array],
      [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
  }
]
SrBrahma commented 2 years ago

Gateway source: https://www.mercadopago.com.br/developers/en/guides/online-payments/checkout-api/testing

crookedneighbor commented 2 years ago

If you have documentation from mastercard/maestro that indicates this bin range needs updating, we'll go ahead and make a change for better accuracy.

SrBrahma commented 2 years ago

Hi, as I saw in the the another lib (https://www.npmjs.com/package/creditcards-types), sometimes test cards don't have a valid number to type conversion. I will be closing this as probably this is the case.