When a customer starts typing their card number, Primer can surface enriched BIN data in the frontend. This includes network details, issuer information such as the country or the bank, or funding type like DEBIT, CREDIT, PREPAID, or DEFERRED_DEBIT. You can use this information to adapt your checkout UI early, before a payment is created. In this guide, you will build a concrete example: block Click to Pay when the selected card network is prepaid, while handling co-badged cards correctly.Documentation Index
Fetch the complete documentation index at: https://primer.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
What you build
You will implement this behavior:- While BIN data is loading, disable Click to Pay and show a short message
- When BIN data is complete, enable Click to Pay unless the selected network is PREPAID
Events you need
Event primer:bin-data-loading-change
Use this event to handle the loading state.
| Property | Type | Description |
|---|---|---|
loading | boolean | true when BIN lookup starts, false when it completes |
Event primer:bin-data-available
Use this event to read BIN data once it is available.
| Property | Type | Description |
|---|---|---|
preferred | BinDataDetails | undefined | Recommended network |
alternatives | BinDataDetails[] | Other detected networks |
status | "partial" | "complete" | Data completeness |
firstDigits | string | undefined | BIN prefix |
status = "partial" means local detection only.status = "complete" means enriched BIN data is available, typically after 8 digits.Only make decisions when
status === "complete".Recipe: block Click to Pay for prepaid cards
This example is framework agnostic. You only need to wiresetClickToPayDisabled to your own Click to Pay button.
Co-badged cards
On co-badged cards, BIN data can include multiple networks for the same card. Each network can have its ownaccountFundingType.
That means:
- Funding type is network specific
- You should evaluate the funding type for the network you will actually use
Example BIN data for a co-badged card
Here is an example payload you may see in the frontend for a co-badged card:How to pick the right funding type
If Primer selects the network automatically
Use thepreferred network from the event payload:
If the customer can select a network
Evaluate funding type for the selected network:See also
Events reference
Full reference for BIN data events and payload types
Events guide
When, why, and how to use events in your integration