security_code library

Constants

ALT_SECURITY_CODE_LENGTH → const int
The alternate length of the security code (only American Express cards use this) Set to 4
4
DEFAULT_SECURITY_CODE_LENGTH → const int
Checks the validity of the CVV or security code for the credit card The default length of the CVV or security code (most cards do this) Set to 3
3

Functions

validateSecurityCode(String code, CreditCardType type) ValidationResults
Validates the card's security code based on the card type. Default is 3 digits but Amex is the only card provider with security codes that are 4 digits