data class CardData
Data class to hold card info
expiryDate - The card expiry date
CardData(pan: String, cvc: String, expiryDate: ExpiryDate)
Data class to hold card info |
val cvc: String
The card security code |
|
val expiryDate: ExpiryDate
The card expiry date |
|
val pan: String
The card number |
fun formatCardNumber(cardNumber: String): String
Format a given card number to a neat string |
|
fun formatSecurityCode(securityCode: String, cardBrand: CardBrand?): String
Format a given security code |
|
fun isCardNumberValid(cardNumber: String): Boolean
Validate a given credit card number using the Luhn algorithm |
|
fun isSecurityCodeValid(securityCode: String, cardBrand: CardBrand?): Boolean
Validate a given security code Need the card brand to understand the lenght of the security code |