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.
Event primer:bin-data-available
Use this event to read BIN data once it is available.
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