PrimerCardNetwork represents a single card network (card scheme) detected from a card number, together with the display information needed to render it. It is the model used in co-badged card scenarios — when one physical card carries more than one network (for example Cartes Bancaires + Visa) and the shopper, or your UI, must choose which network to route the payment through.
You read PrimerCardNetwork values from PrimerCardFormState (availableNetworks and selectedNetwork) and commit a choice with PrimerCardFormSession.selectCardNetwork(_:).
Definition
You never construct
PrimerCardNetwork yourself. The SDK detects networks from the entered card number and publishes them on PrimerCardFormState.availableNetworks. Use those instances directly when calling selectCardNetwork(_:).Properties
| Property | Type | Description |
|---|---|---|
displayName | String | Human-readable network name for display (e.g. "Visa", "Mastercard", "Cartes Bancaires"). |
network | CardNetwork | The underlying card network value. See CardNetwork. |
allowed | Bool | true when this network is enabled for the current merchant configuration. |
allowsUserSelection | Bool | true when the shopper may choose this network in a co-badged selector. false for networks that auto-route (e.g. EFTPOS). |
issuerCountryCode | String? | ISO country code of the card issuer, when known. |
issuerName | String? | Name of the card issuer, when known. |
accountFundingType | String? | Account funding type (e.g. credit/debit), when known. |
prepaidReloadableIndicator | String? | Indicator describing whether a prepaid card is reloadable, when known. |
productUsageType | String? | Product usage type reported by the network, when known. |
productCode | String? | Network product code, when known. |
productName | String? | Network product name, when known. |
issuerCurrencyCode | String? | ISO currency code associated with the issuer, when known. |
regionalRestriction | String? | Regional restriction reported by the network, when known. |
accountNumberType | String? | Account number type reported by the network, when known. |
displayName, network, allowed, and allowsUserSelection are the properties you need for co-badge selection. The remaining String? properties carry optional issuer/BIN metadata that is populated only when the SDK resolves it remotely; treat them as supplementary display data.CardNetwork
network is a CardNetwork — a String-backed enum identifying the scheme. Its raw value matches the network’s canonical uppercase identifier.
The source declaration also conforms to an internal logging protocol that is not part of the public contract; it is omitted here.
| Case | Raw value | Display name |
|---|---|---|
.amex | AMEX | American Express |
.bancontact | BANCONTACT | Bancontact |
.cartesBancaires | CARTES_BANCAIRES | Cartes Bancaires |
.diners | DINERS_CLUB | Diners |
.discover | DISCOVER | Discover |
.eftpos | EFTPOS | EFTPOS |
.elo | ELO | Elo |
.hiper | HIPER | Hiper |
.hipercard | HIPERCARD | Hiper |
.jcb | JCB | JCB |
.maestro | MAESTRO | Maestro |
.masterCard | MASTERCARD | Mastercard |
.mir | MIR | Mir |
.visa | VISA | Visa |
.unionpay | UNIONPAY | UnionPay |
.unknown | OTHER | Unknown |
| Member | Type | Description |
|---|---|---|
displayName | String | Human-readable network name. |
icon | UIImage? | Branded network icon, or nil when none is bundled. |
traits | PrimerCardNetworkTraits? | PAN length, gap pattern, and CVV metadata for the network, or nil. |
init(cardNumber: String) | — | Detects the network from a card number, falling back to .unknown. |
init(cardNetworkStr: String) | — | Resolves a network from a string identifier, falling back to .unknown. |
Co-badged card selection
When the entered card number resolves to more than one network, the card form publishes those options onPrimerCardFormState. Read them inside any PrimerCardForm slot through the injected PrimerCardFormSession:
| State property | Type | Description |
|---|---|---|
availableNetworks | [PrimerCardNetwork] | Networks detected from the card number. More than one indicates a co-badged card. |
selectedNetwork | PrimerCardNetwork? | The currently selected network, or nil while the network is auto-detected. |
availableNetworks instances to the session:
| Method | Description |
|---|---|
selectCardNetwork(_ network: PrimerCardNetwork) | Selects a network for a co-badged card. Applicable only when availableNetworks contains more than one network. |
Building a custom selector
Render only networks where
allowsUserSelection is true (and that are allowed). Networks that auto-route — such as EFTPOS — are resolved by the SDK and should not appear as a manual choice.Using the built-in selector
If you don’t need a fully custom picker, the SDK ships a ready-made dropdown. The defaultcardDetails section renders it automatically once a co-badged card is detected. When you recompose the individual card fields yourself, add the standalone selector with CardFormDefaults.cardNetwork(_:) — it already gates on availableNetworks.count > 1 and calls selectCardNetwork(_:) for you. See Card field components.
See also
Card Form Session
State, network selection, and submission for the card form.
Card field components
The built-in co-badge selector and other per-field building blocks.
PrimerCardForm
The card form view and its slots.