Recipe
How it works
- Listen for the
primer:bin-data-availableevent - Use
preferred.networkto get the card brand identifier - Update your UI with the appropriate logo or icon
preferred field contains the recommended card network based on orderedAllowedCardNetworks. It is undefined when no network is detected (e.g., empty input or insufficient digits).
The preferred object
Thepreferred object contains the detected card network and, when status is 'complete', additional issuer details:
See the Events Reference for the full
BinDataDetails type definition.Example values
Supported card networks
network | displayName |
|---|---|
VISA | Visa |
MASTERCARD | Mastercard |
AMEX | American Express |
DISCOVER | Discover |
DINERS_CLUB | Diners Club |
JCB | JCB |
MAESTRO | Maestro |
UNIONPAY | UnionPay |
ELO | Elo |
HIPER | Hiper |
HIPERCARD | Hipercard |
MIR | Mir |
INTERAC | Interac |
CARTES_BANCAIRES | Cartes Bancaires |
DANKORT | Dankort |
EFTPOS | Eftpos |
ENROUTE | Enroute |
OTHER | Other |
Variations
Show a loading indicator
Useprimer:bin-data-loading-change to indicate when BIN data is being fetched:
Display card network name
For user-facing text, usedisplayName instead of network:
Show/hide based on detection
Handle co-badged cards
Some cards support multiple networks (e.g., Carte Bancaire / Visa). Usealternatives to offer a network picker: