CreditCardValidator class

CreditCardValidator helps with validating credit card numbers, expiration dates, and security codes. It is meant to validate the credit card as the user is typing in the card information

Exposes 3 public functions which can be used to validate different parts of the credit card

Constructors

CreditCardValidator()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validateCCNum(String ccNumStr, {bool luhnValidateUnionPay = false, bool ignoreLuhnValidation = false}) CCNumValidationResults
Validates based on type of card, luhn validity & card number length
validateCVV(String cvv, CreditCardType cardType) ValidationResults
Validates the security code based on the length of the code in conjunction with the type of card
validateExpDate(String expDateStr) ValidationResults
Validates the card's expiration date based on the date being a valid string & not expiring more than 19 years in the future.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

unknownCardType → CreditCardType
final