inacho / php-credit-card-validator

Validates popular debit and credit cards numbers against regular expressions and Luhn algorithm. Also validates the CVC and the expiration date.
MIT License
199 stars 104 forks source link

CVC check doesn't work against a validmastercard #1

Closed trollboy closed 9 years ago

trollboy commented 9 years ago

Used my mastercard to test, has a cvc w 2 digits over 5

inacho commented 9 years ago

The CVC of MasterCard always have a length of 3 digits. For example: 123 What is the length of your CVC?

trollboy commented 9 years ago

3 digits total

inacho commented 9 years ago

It should work fine. The CVC is only validated against the length defined in the rules.

This code will output bool(true):

var_dump(CreditCard::validCvc('123', 'mastercard'));

Check that you CVC don't contain spaces with the trim function

trollboy commented 9 years ago

Verified that I'm running trim "179" fails still