io.paymenthighway.sdk.model / ExpiryDate

ExpiryDate

data class ExpiryDate

Data class to hold expiry data

Parameters

id - Actual account id as String

month - 1-2 numeric chars, accepted 1-12

year -

1-4 numeric chars. For years <= 999 2000 is added

You can check if expiry date is valid with isValid

Constructors

<init>

ExpiryDate(month: String, year: String)

Data class to hold expiry data

Properties

isValid

val isValid: Boolean

Check if the expiry date is valid

month

val month: String

1-2 numeric chars, accepted 1-12

year

val year: String

1-4 numeric chars. For years <= 999 2000 is added

Companion Object Functions

format

fun format(expiryDate: String, deleting: Boolean = false): String

Format the expiration date

fromString

fun fromString(expiryDate: String): ExpiryDate?

Get ExpiryDate from raw expiration date string

isValid

fun isValid(expiryDateString: String): Boolean

Check if expiration date is valid