CardBrand

enum CardBrand : Enum<CardBrand>

A representation of supported card brands and related data

Entries

Link copied to clipboard
Unknown("unknown", "Unknown", R.drawable.stripe_ic_unknown, setOf(3, 4), emptyMap())
Link copied to clipboard
UnionPay("unionpay", "UnionPay", R.drawable.stripe_ic_unionpay, Pattern.compile("^(62|81)[0-9]*$"), mapOf( 1 to Pattern.compile("^6|8$"), ))
Link copied to clipboard
MasterCard("mastercard", "Mastercard", R.drawable.stripe_ic_mastercard, Pattern.compile("^(2221|2222|2223|2224|2225|2226|2227|2228|2229|222|223|224|225|226|227|228|229|23|24|25|26|270|271|2720|50|51|52|53|54|55|56|57|58|59|67)[0-9]*$"), mapOf( 1 to Pattern.compile("^2|5|6$"), 2 to Pattern.compile("^(22|23|24|25|26|27|50|51|52|53|54|55|56|57|58|59|67)$") ))
Link copied to clipboard
Visa("visa", "Visa", R.drawable.stripe_ic_visa, Pattern.compile("^(4)[0-9]*$"), mapOf( 1 to Pattern.compile("^4$") ))
Link copied to clipboard
DinersClub("diners", "Diners Club", R.drawable.stripe_ic_diners, 16, Pattern.compile("^(36|30|38|39)[0-9]*$"), mapOf( 1 to Pattern.compile("^3$") ), mapOf( Pattern.compile("^(36)[0-9]*$") to 14 ))

Diners Club

Link copied to clipboard
JCB("jcb", "JCB", R.drawable.stripe_ic_jcb, Pattern.compile("^(352[89]|35[3-8][0-9])[0-9]*$"), mapOf( 1 to Pattern.compile("^3$"), 2 to Pattern.compile("^(35)$"), 3 to Pattern.compile("^(35[2-8])$") ))

JCB

Link copied to clipboard
Discover("discover", "Discover", R.drawable.stripe_ic_discover, Pattern.compile("^(60|64|65)[0-9]*$"), mapOf( 1 to Pattern.compile("^6$") ))
Link copied to clipboard
AmericanExpress("amex", "American Express", R.drawable.stripe_ic_amex, R.drawable.stripe_ic_cvc_amex, setOf(3, 4), 15, Pattern.compile("^(34|37)[0-9]*$"), mapOf( 1 to Pattern.compile("^3$") ))

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun isMaxCvc(cvcText: String?): Boolean
Link copied to clipboard
fun isValidCardNumberLength(cardNumber: String?): Boolean

Checks to see whether the input number is of the correct length, given the assumed brand of the card. This function does not perform a Luhn check.

Link copied to clipboard
fun isValidCvc(cvc: String): Boolean

Properties

Link copied to clipboard
val code: String
Link copied to clipboard
val cvcIcon: Int
Link copied to clipboard
val cvcLength: Set<Int>

Accepted CVC lengths

Link copied to clipboard
val displayName: String
Link copied to clipboard
val errorIcon: Int
Link copied to clipboard
val icon: Int
Link copied to clipboard
val maxCvcLength: Int
Link copied to clipboard
val name: String
Link copied to clipboard
val ordinal: Int