Learn about customisation options for the card brand selector.
const cardBrandSelectorConfig: CardBrandSelectorComponentConfig = {
useDefaultMode: boolean,
showOnlyRecognisedCardBrand: boolean,
includeAcceptedCardBrandsInDefaultMode: boolean,
unrecognisedCardNumberAltText: string,
defaultCardImage: CardImageConfig,
cardBrandImages: {
visa: CardImageConfig,
mastercard: CardImageConfig,
amex: CardImageConfig,
cup: CardImageConfig,
diners: CardImageConfig,
discover: CardImageConfig,
jcb: CardImageConfig,
},
useTransparentCardBrandImage: boolean
};| Parameter | Description |
|---|---|
useDefaultModeboolean | Whether to use the default mode for card brand selection. If true, displays a default card brand selector behaviour. |
showOnlyRecognisedCardBrandboolean | Whether to display only recognised card brands. If true, only displays card brands that have been successfully identified from the card number. |
includeAcceptedCardBrandsInDefaultModeboolean | Whether to include accepted card brands in default mode. If true and useDefaultMode is true, displays all accepted card brands. |
unrecognisedCardNumberAltTextstring | The alternative text for the unrecognised card number. |
defaultCardImageCardImageConfig | Configuration for the default card image displayed when no specific card brand is selected or when the card brand is not recognised. |
cardBrandImagesobject | Configuration object containing image settings for different card brands. |
cardBrandImages.visaCardImageConfig | Settings for the Visa card brand image. |
cardBrandImages.mastercardCardImageConfig | Settings for the Mastercard card brand image. |
cardBrandImages.amexCardImageConfig | Settings for the Amex card brand image. |
cardBrandImages.cupCardImageConfig | Settings for the CUP card brand image. |
cardBrandImages.dinersCardImageConfig | Settings for the Diners card brand image. |
cardBrandImages.discoverCardImageConfig | Settings for the Discover card brand image. |
cardBrandImages.jcbCardImageConfig | Settings for the JCB card brand image. |
useTransparentCardBrandImageboolean | Whether to use transparent card brand images. Defaults to true. |
const cardBrandSelectorConfig: CardBrandSelectorComponentConfig = {
useDefaultMode: true,
showOnlyRecognisedCardBrand: false,
includeAcceptedCardBrandsInDefaultMode: true,
useTransparentCardBrandImage: true,
unrecognisedCardNumberAltText: "Unknown card type",
defaultCardImage: {
src: "/images/default-card.svg",
width: "32px",
height: "20px"
},
cardBrandImages: {
visa: {
src: "/images/visa.svg",
width: "32px",
height: "20px"
},
mastercard: {
src: "/images/mastercard.svg",
width: "32px",
height: "20px"
},
amex: {
src: "/images/amex.svg",
width: "32px",
height: "20px"
}
}
};