Skip to main content

Card Network Configuration

Use the CardType enum to configure which card types are accepted in your PayNext SDK checkout form:
  • diners-club
  • jcb
  • maestro
  • mastercard
  • unionpay
  • visa

Card Network Details

Each card network has specific validation rules and formatting:
Pattern: Cards starting with 30[0-5] or 3[68]
Length: 14-16 digits
CVC: 3 digits
Example: 3056 9300 0902 0004
Pattern: Cards starting with 35, 2131, or 1800
Length: 15-16 digits
CVC: 3 digits
Example: 3530 1113 3330 0000
Pattern: Various patterns including 50, 56-58, 6304, 6759, 6761, 6763
Length: 12-19 digits
CVC: 3 digits
Example: 6771 8980 0000 0000 021
Pattern: Cards starting with 5[1-5]
Length: 16 digits
CVC: 3 digits
Example: 5555 5555 5555 4444
Pattern: Cards starting with 62 (excluding 627)
Length: 16-19 digits
CVC: 3 digits
Example: 6200 0000 0000 0005
Pattern: Cards starting with 4
Length: 16 digits
CVC: 3 digits
Example: 4242 4242 4242 4242

Card Network Detection

The PayNext SDK automatically detects the card network based on the card number as the user types:
custom component
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
}
The PayNext SDK provides real-time card network detection and validation as users enter their card details. Refer to Mount the Checkout for the complete mounting flow.
Some card networks may not be supported by all payment processors. Check with your payment processor for specific network availability.