DLCardExpert

class DLCardExpert(countryCode: String)

Entry point for dLocal Card Expert Use this instance to validate and format input fields for your card form.

Constructors

Link copied to clipboard
constructor(countryCode: String)

Creates an instance of DLCardExpert

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Return a list with all card brands supported in the country.

Functions

Link copied to clipboard
fun brand(withIdentifier: DLCardBrandIdentifier): DLCardBrand?
fun brand(withIdentifier: String): DLCardBrand?

Detect card brand for an specific card identifier or null if it's not supported.

Link copied to clipboard

Detect card brand from a complete or partial card number.

Link copied to clipboard

Format a card number based on the visible ending part

Link copied to clipboard
fun formatCardNumber(cardNumber: String): String

Format a card number based on the rules of the brands selected

Link copied to clipboard

Format an expiration date

Link copied to clipboard

Format only the month part of the expiration date

Link copied to clipboard

Format only the year part of the expiration date

Link copied to clipboard

Format a card holder name to only uppercase letters

Link copied to clipboard

Format a security code based on the card brand rules

Link copied to clipboard

Validates if a complete or partial card number is a valid card number.

Link copied to clipboard
fun validateExpirationDate(expirationDate: String): Boolean

Validates if a String input is a valid date.

Link copied to clipboard
fun validateName(holderName: String): Boolean

Validate the card holder name.

Link copied to clipboard
fun validateSecurityCode(securityCode: String, brands: List<DLCardBrand>?): Boolean

Validates if a String input is a valid security code for the given card brands.