braintree / credit-card-type

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

Information about optional security codes (CVV/CVC etc.) #124

Closed bartlomiejgawel closed 3 years ago

bartlomiejgawel commented 3 years ago

General information

Issue description

For some credit cards (for example Maestro starting with 6703) the security code is optional. However, when I use the getTypeInfo method, I don't know whether it's required or not.

{
    "niceType": "Maestro",
    "type": "maestro",
    "patterns": [
        493698,
        [
            500000,
            504174
        ],
        [
            504176,
            506698
        ],
        [
            506779,
            508999
        ],
        [
            56,
            59
        ],
        63,
        67,
        6
    ],
    "gaps": [
        4,
        8,
        12
    ],
    "lengths": [
        12,
        13,
        14,
        15,
        16,
        17,
        18,
        19
    ],
    "code": {
        "name": "CVC",
        "size": 3
    }
}

Do you have any plans to add this information?

crookedneighbor commented 3 years ago

Do you have any documentation that indicates that all 6703 cards have an optional cvv? As far as I know, there's no way to tell from just the bin that the card in question has an optional cvv, but if there's some documentation from Maestro that lines out the cases, would love to see it.

bartlomiejgawel commented 3 years ago

I've tried to find any documentation for these cases with no success. The only thing I came across was a general mention. I even sent a request for security code requirements to some payment providers, but responses were different. Some of them require a security code for all credit cards, others don't (but they didn't provide any criteria).

I think it will be best to stay with the current approach. Thank you for your answer (and for this awesome library)!