CardValidator

interface CardValidator

Validates individual card details components.

Functions

Link copied to clipboard

Checks whether a given cardNumber is valid and matches any of the supported CardScheme.

Link copied to clipboard

Checks whether a given cardNumber is valid and matches any of the supported CardScheme. Must also pass luhn and length checks.

Link copied to clipboard
abstract fun validateCvv(cvv: String, cardScheme: CardScheme): ValidationResult<Unit>

Validates the given cvv according to the cardScheme.

Link copied to clipboard
abstract fun validateExpiryDate(expiryMonth: Int, expiryYear: Int): ValidationResult<ExpiryDate>

Validates the given expiryMonth&expiryYear integer values, checking the input is valid and that the representing expiry date is in the future.

abstract fun validateExpiryDate(expiryMonth: String, expiryYear: String): ValidationResult<ExpiryDate>

Validates the given expiryMonth&expiryYear string values, checking the input is valid and that the representing expiry date is in the future.