Skip to main content
Display the detected card network (Visa, Mastercard, etc.) as users enter their card number.

Recipe

How it works

  1. Listen for the primer:bin-data-available event
  2. Use preferred.network to get the card brand identifier
  3. Update your UI with the appropriate logo or icon
The 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

The preferred object contains the detected card network and, when status is 'complete', additional issuer details:
See the Events Reference for the full BinDataDetails type definition.

Supported card networks

On Android, these are values of the CardNetwork.Type enum, each with a displayName property. On iOS, the network raw values map to cases of the CardNetwork enum; a few display names and the supported set differ (iOS has no DANKORT and adds BANCONTACT). See PrimerCardNetwork for the authoritative iOS list.

Variations

Show a loading indicator

Use primer:bin-data-loading-change to indicate when BIN data is being fetched:

Display card network name

For user-facing text, use displayName instead of network:

Show/hide based on detection

Co-badge network selector

Some cards support multiple networks (e.g., Carte Bancaire / Visa). Use alternatives to offer a network picker:

Use icon font or CSS classes

See also

Build a custom card form

Step-by-step guide to building a fully custom card form

Events guide

Handle payment lifecycle events

Use BIN data for Click to Pay

Control Click to Pay based on BIN data