VgsCardBrand

data class VgsCardBrand(val name: String, val mask: String, val regex: String, val algorithm: VgsCardBrand.ChecksumAlgorithm, val length: IntArray, val securityCodeLength: IntArray, @DrawableRes val cardIcon: Int, @DrawableRes val securityCodeIcon: Int)

Describes a payment card brand and the rules used to recognise and validate it.

The card-number field auto-detects the brand from the current input against the brands it was created with (see supportedCardBrands on com.verygoodsecurity.vgscollect.widget.compose.state.VgsCardNumberTextFieldState). The detected brand is exposed as cardBrand on the state so the UI can react — e.g. by drawing cardIcon in a trailingIcon.

Use DEFAULT for the built-in brands or build your own list (custom brand

Parameters

name

display name of the brand (e.g. "VISA").

mask

formatted display pattern, e.g. "#### #### #### ####".

regex

pattern that matches card numbers belonging to this brand.

algorithm

checksum used to validate the full number.

length

set of valid total card-number lengths.

securityCodeLength

set of valid CVC lengths for this brand.

cardIcon

drawable resource for the brand's front-of-card icon.

securityCodeIcon

drawable resource for the matching CVC icon.

Constructors

Link copied to clipboard
constructor(name: String, mask: String, regex: String, algorithm: VgsCardBrand.ChecksumAlgorithm, length: IntArray, securityCodeLength: IntArray, @DrawableRes cardIcon: Int, @DrawableRes securityCodeIcon: Int)

Types

Link copied to clipboard

Checksum algorithm used to validate card numbers for a brand.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int