> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paynext.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Card Networks

> Configure the card networks to accept in the PayNext SDK checkout form.

## Card Network Configuration

Use the `CardType` enum to configure which card types are accepted in your PayNext SDK checkout form:

* `discover`
* `jcb`
* `mastercard`
* `visa`
* `amex` (`CardType.AmericanExpress`) — Apple Pay / Google Pay only; **not** accepted on the card form

The card form accepts Visa, Mastercard, Discover, and JCB. American Express is a wallet-only network: it can be passed for Apple Pay and Google Pay via [`acceptedCardNetworks`](/sdk-reference/web-sdk/customization/behavior#restrict-card-networks-per-payment-method), but is never accepted on the card form.

## Card Network Details

Each card network has specific validation rules and formatting:

<AccordionGroup>
  <Accordion title="Discover">
    **Pattern**: Cards starting with `6011` or `65`\
    **Length**: 16 digits\
    **CVC**: 3 digits\
    **Example**: `6011 1111 1111 1117`
  </Accordion>

  <Accordion title="JCB">
    **Pattern**: Cards starting with `35`, `2131`, or `1800`\
    **Length**: 15-16 digits\
    **CVC**: 3 digits\
    **Example**: `3530 1113 3330 0000`
  </Accordion>

  <Accordion title="Mastercard">
    **Pattern**: Cards starting with `5[1-5]`\
    **Length**: 16 digits\
    **CVC**: 3 digits\
    **Example**: `5555 5555 5555 4444`
  </Accordion>

  <Accordion title="Visa">
    **Pattern**: Cards starting with `4`\
    **Length**: 16 digits\
    **CVC**: 3 digits\
    **Example**: `4242 4242 4242 4242`
  </Accordion>
</AccordionGroup>

## Card Network Detection

The PayNext SDK automatically detects the card network based on the card number as the user types:

```typescript custom component theme={"system"}
import { PayNextCheckout, type PayNextConfig } from '@paynext/sdk'

export async function mountWithNetworkLogging(
  containerId: string,
  baseConfig: PayNextConfig
) {
  const checkout = new PayNextCheckout()
  await checkout.mount(containerId, {
    ...baseConfig,
    onCheckoutComplete: (result) => {
      // Access detected card network
      console.log(
        'Card network:',
        result.payment_method?.details?.bin_data?.brand
      )
    },
  })
  return checkout
}
```

<Info>
  The PayNext SDK provides real-time card network detection and validation as users enter their card details. Refer to [Mount the Checkout](/sdk-reference/introduction/getting-started#mount-the-checkout) for the complete mounting flow.
</Info>

<Warning>
  Some card networks may not be supported by all payment processors. Check with your payment processor for specific network availability.
</Warning>
