io.paymenthighway.sdk.model / CardData

CardData

data class CardData

Data class to hold card info

Parameters

pan - The card number

cvc - The card security code

expiryDate - The card expiry date

Constructors

<init>

CardData(pan: String, cvc: String, expiryDate: ExpiryDate)

Data class to hold card info

Properties

cvc

val cvc: String

The card security code

expiryDate

val expiryDate: ExpiryDate

The card expiry date

pan

val pan: String

The card number

Companion Object Functions

formatCardNumber

fun formatCardNumber(cardNumber: String): String

Format a given card number to a neat string

formatSecurityCode

fun formatSecurityCode(securityCode: String, cardBrand: CardBrand?): String

Format a given security code

isCardNumberValid

fun isCardNumberValid(cardNumber: String): Boolean

Validate a given credit card number using the Luhn algorithm

isSecurityCodeValid

fun isSecurityCodeValid(securityCode: String, cardBrand: CardBrand?): Boolean

Validate a given security code Need the card brand to understand the lenght of the security code