preferredScheme so the payment is routed accordingly.
How it works
- As the shopper enters their card number, the SDK performs a BIN lookup and resolves the available networks.
- If the card is single-branded, only one brand applies and no selector is shown.
- If the card is co-branded, the SDK renders both scheme logos inside the card-number field and exposes the available schemes (
cardSchemes) so a brand selector can be shown. - The display order and the pre-selected brand follow the merchant’s
preferredSchemes, which is initially registered based on your merchant preference; if none is configured, the card’s local network is preferred. - The shopper’s choice is sent to Payrails as
paymentInstrumentData.preferredScheme(a single network code such ascartesbancairesormada).
preferredSchemes (merchant) vs preferredScheme (shopper)These two names look alike but refer to different things:preferredSchemes(plural) is the merchant’s preference — an ordered list registered per account that drives the brand display order and which brand is pre-selected. You don’t set it in code; it’s delivered to the SDK on initialization.preferredScheme(singular) is the shopper’s choice — the single brand the shopper picks in the card brand selector, submitted to Payrails on the payment payload aspaymentInstrumentData.preferredScheme.
AvailabilityThe co-branded card journey is available in the web SDK from version
5.48.0 and the React Native SDK from version 2.10.0.Enabling co-branded cardsThe co-branded journey is enabled per account and runs on the SDK’s secure-fields rendering path. Your scheme preference order (
preferredSchemes) is configured on the Payrails side and delivered to the SDK automatically — you don’t pass it in code. Reach out to your Payrails contact to enable it for your account.By integration type
The journey behaves the same across Payrails SDKs; the code examples below are for the web SDK. How much you need to build depends on which integration you use:CardScheme shape
Both the Card Form onChange event and the Secure Fields CHANGE event expose the available networks as a cardSchemes array. It is only present for co-branded cards.
Drop-in and Card Form
With Drop-in and the Card Form element, the SDK renders a “Card Brand” selector beneath the form whenever a co-branded card is detected, and submits the shopper’s choice automatically. No extra integration code is required. You can tailor the selector’s wording and look to match your checkout:translations and styles.cardBrandSelector options apply to the cards section of a Drop-in configuration.
Secure Fields
With Secure Fields you build your own form and pay button, so you also render your own brand selector. The SDK still detects the co-branded card and shows the dual logos in the card-number field (whenenableCardIcon is on); your job is to read the schemes, track the shopper’s choice, and pass it on the payment payload.