Are you looking for test card numbers?

Would you like to contact support?

Payment-method icon

Card Component

Add card payments to an existing Components integration.

Our Card Component renders the available cards in your payment form, and securely collects any sensitive card information, so it doesn't touch your server.

When using the Card Component, you can:

If you want more UI freedom for building your card input fields, use our Custom Card Component.

Before you begin

This page explains how to add cards to your existing Web Components integration. The Web Components integration works the same way for all payment methods. If you haven't done this integration yet, refer to our Components integration guide.

Before starting your cards integration:

  1. Make sure that you have set up your back end implementation, and created an instance of AdyenCheckout.
  2. Add the cards that you want to accept in your test Customer Area.

Show the available cards in your payment form

For information about the supported countries and currencies for each card, refer to Payment methods.

To show the Card Component in your payment form:

  1. Specify in your /paymentMethods request a combination of countryCode and amount.currency. This is used to determine which cards are available to the shopper.

  2. Add the Card Component:

    a. Create a DOM element for cards, placing it where you want the card form to be rendered:

    <div id="card-container"></div>

    b. Create an instance of the Card Component, and mount it. You can also include optional configuration:

    Field Description Default
    brands Array of card brands that will be recognized. For a list of possible values, refer to Supported card types. ['mc','visa','amex']
    brandsConfiguration v 4.5.0 Object where you can customize the icons for different brands. For example, to customize the icon for Visa, include inside the brandsConfiguration:
    visa: { icon: 'https://...' }

    showBrandIcon Set to false to have Web Card Component not show the brand logo when the card brand has been recognized. true
    enableStoreDetails Set to true to show the check box for saving the card details for recurring payments. false
    hasHolderName Set to true to show the input field for the card holder name. false
    holderNameRequired Set to true to make the card holder name a required field. To show the field, you additionally need to set hasHolderName to true. false
    positionHolderNameOnTop v 4.2.0 Renders the cardholder name field at the top of the payment form. false
    hideCVC Set to true to hide the CVC field. false
    socialSecurityNumberMode v 4.2.0 Renders a social security number field. For example, this is required for certain card payments in Brazil. Possible values are:
    - show: Always renders the field.
    - hide: Never renders the field.
    - auto: Renders the field based on the card's BIN.
    styles Set a style object to customize the card input fields.
    For a list of supported properties, refer to Styling card input fields.
    Refer to
    Default styles and labels.

    billingAddressRequired v 3.5.0 Set to true to collect the shopper's billing address. false
    billingAddressAllowedCountries Specify allowed country codes for the billing address. For example, ['US', 'CA', 'BR']. The Country field dropdown menu shows a list of all countries.
    data Object that contains placeholder information that you can use to prefill fields.
    For example:
    - holderName: Placeholder for the card holder name field.
    - billingAddress: Object that contains placeholder information for the billing address such as street, postalCode, city, country, and stateOrProvince.
    installmentOptions If you want to offer credit card installments, specify here the numbers of monthly installments that the shopper can choose from.
    For example, to have 2, and 3, and 4 as the default installment options for all cards:
    { "card": { "values": [2, 3, 4] }}.

    v 3.15.0 You can also configure plans for Japanese installments: regular, revolving, or both.
    Refer to Show installment payment options for a code sample.
    v 3.15.0
    plans: regular

    minimumExpiryDate v 4.3.0 If a shopper enters a date that is earlier than specified here, they will see the following error:
    "Your card expires before check out date."
    Format: mm/yy

    showInstallmentAmounts v 3.15.0 If you want to offer credit card installments, set to true to show the payment amount per installment.
    Refer to Show installment payment options for a code sample.

    You can also customize your shopper's experience when specific events occur.

    Event Description
    onChange Called when the shopper enters data in the card input fields. Here you have the option to override your main Adyen Checkout configuration.
    onLoad Called once all the card input fields have been created but are not yet ready to use.
    onConfigSuccess Called once the card input fields are ready to use.
    onFieldValid Called when a field becomes valid and also if a valid field changes and becomes invalid. For the card number field, it returns the last 4 digits of the card number.
    onBrand Called once we detect the card brand.
    onError Called in case of an invalid card number, invalid expiry date, or incomplete field. Called again when errors are cleared.
    onFocus Called when a field gains or loses focus.
    onBinLookup v 3.21.0 Provides the type of the card, and the brands, supportedBrands, and detectedBrands arrays. Called as the user inputs the PAN.
    onBinValue v 3.10.1 Provides the BIN Number of the card (up to 6 digits), called as the user types in the PAN. Requires the client key for client-side authentication.
     const card = checkout.create("card", {
         // Optional configuration
         enableStoreDetails: true,
         hasHolderName: true,
         holderNameRequired: true,
         billingAddressRequired: true, // Optional. Set to true to show the billing address input fields.
         brands: ["visa", "amex"],
         onBrand: handleOnBrand // Your function for handling onBrand event
         data : {
             holderName: 'S. Hopper'

Show installment payment options

If you are offering credit card installments, you can configure the Card Component to show options for credit card installment payments by adding installmentOptions and showInstallmentAmounts in the card configuration. In the UI, shoppers can choose the type and the number of installments.

     paymentMethodsConfiguration: {
        card: {
          installmentOptions: { // Example optional installment configuration for cards
            visa: {
                // Shows 1, 2, and 3 as the numbers of monthly installments shoppers can choose.
                values: [1, 2, 3],
                // Shows regular and revolving as plans shoppers can choose.
                plans: [ 'regular', 'revolving' ]
            mc: {
          // Set to true to show payment amount per installment.
          showInstallmentAmounts: false

Make a payment

When the shopper selects to pay, the Component calls the onChange event, which contains a

  1. If state.isValid is true, collect the and pass this to your server.
  2. From your server, make a /payments request, specifying:

    • paymentMethod: The from the onChange event.

    Here is how you would make a payment request for 10 USD.

    curl \
    -H "x-API-key: YOUR_X-API-KEY" \
    -H "content-type: application/json" \
    -d '{
      "{ from onChange or onSubmit}paymentMethod{/hint}": {
        "type": "scheme",
        "encryptedCardNumber": "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        "encryptedExpiryMonth": "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        "encryptedExpiryYear": "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        "encryptedSecurityCode": "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        "holderName": "S. Hopper"
      "{ from onChange or onSubmit}billingAddress{/hint}": {
        "street": "Infinite Loop",
        "houseNumberOrName": "1",
        "postalCode": "95014",
        "city": "Cupertino",
        "stateOrProvince": "CA",
        "country": "US"
      "returnUrl": "",
    # Set your X-API-KEY with the API key from the Customer Area.
    adyen =
    adyen.api_key = "YOUR_X-API-KEY"
    response = adyen.checkout.payments({
      :amount => {
        :currency => "USD",
        :value => 1000
      :reference => "YOUR_ORDER_NUMBER",
      :paymentMethod => {
        :type => "scheme",
        :encryptedCardNumber => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        :encryptedExpiryMonth => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        :encryptedExpiryYear => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        :encryptedSecurityCode => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        :holderName => "S. Hopper"
      :billingAddress => {
        :city => "Cupertino",
        :country => "US",
        :houseNumberOrName => "1",
        :postalCode => "95014",
        :stateOrProvince => "CA",
        :street => "Infinite Loop"
      :returnUrl => "",
      :merchantAccount => "YOUR_MERCHANT_ACCOUNT"
    Client client = new Client("YOUR_API_KEY", Environment.TEST);
        Checkout checkout = new Checkout(client);
        PaymentsRequest paymentsRequest = new PaymentsRequest();
        DefaultPaymentMethodDetails paymentMethodDetails = new DefaultPaymentMethodDetails();
        paymentMethodDetails.setHolderName("S. Hopper");
        Amount amount = new Amount();
        Address billingAddress = new Address();
        billingAddress.setStreet("Infinite Loop");
        PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);
    // Set your X-API-KEY with the API key from the Customer Area.
    $client = new \Adyen\Client();
    $service = new \Adyen\Service\Checkout($client);
    $params = array(
      "amount" => array(
        "currency" => "USD",
        "value" => 1000
      "reference" => "YOUR_ORDER_NUMBER",
      "paymentMethod" => array(
        "type" => "scheme",
        "encryptedCardNumber" => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        "encryptedExpiryMonth" => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        "encryptedExpiryYear" => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        "encryptedSecurityCode" => "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
        "holderName" => "S. Hopper"
      "billingAddress" => [
        "city" => "Cupertino",
        "country" => "US",
        "houseNumberOrName" => "1",
        "stateOrProvince" => "CA",
        "postalCode" => "95014",
        "street" => "Infinite Loop"
      "returnUrl" => "",
      "merchantAccount" => "YOUR_MERCHANT_ACCOUNT"
    $result = $service->payments($params);
    # Set your X-API-KEY with the API key from the Customer Area.
    adyen = Adyen.Adyen()
    adyen.client.xapikey = 'YOUR_X-API-KEY'
    result = adyen.checkout.payments({
      "amount": {
        "currency": "USD",
        "value": 1000
      "paymentMethod": {
        "type": "scheme",
        "encryptedCardNumber": "adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..",
        "encryptedExpiryMonth": "adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..",
        "encryptedExpiryYear": "adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..",
        "encryptedSecurityCode": "adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..",
        "holderName": "S. Hopper"
      "billingAddress": {
        "street": "Infinite Loop",
        "houseNumberOrName": "1",
        "postalCode": "95014",
        "city": "Cupertino",
        "stateOrProvince": "CA",
        "country": "US"
      "returnUrl": "",
      "merchantAccount": "YOUR_MERCHANT_ACCOUNT"
    // Set your X-API-KEY with the API key from the Customer Area.
    var client = new Client ("YOUR-X-API-KEY", Environment.Test);
    var checkout = new Checkout(client);
    var paymentRequest = new Adyen.Model.Checkout.PaymentRequest
        Amount = new Model.Checkout.Amount(Currency: "USD", Value: 1000),
        Reference = "YOUR_ORDER_NUMBER",
        PaymentMethod = new DefaultPaymentMethodDetails
            EncryptedCardNumber = "adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..",
            EncryptedExpiryMonth = "adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..",
            EncryptedExpiryYear = "adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..",
            EncryptedSecurityCode = "adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..",
            HolderName = "S. Hopper",
            Type = "scheme"
        BillingAddress = new Model.Checkout.Address
            City = "Cupertino",
            Country = "US",
            HouseNumberOrName = "1",
            StateOrProvince = "CA",
            PostalCode = "95014",
            Street = "Infinite Loop"
        ShopperIP = "",
        Channel = Model.Checkout.PaymentRequest.ChannelEnum.Web,
        Origin = "",
        ReturnUrl = "",
        MerchantAccount = "YOUR_MERCHANT_ACCOUNT"
    var paymentResponse = checkout.Payments(paymentsRequest);
    // Set your X-API-KEY with the API key from the Customer Area.
    const {Client, Config, CheckoutAPI} = require('@adyen/api-library');
    const config = new Config();
    config.apiKey = '[API_KEY]';
    config.merchantAccount = '[YOUR_MERCHANT_ACCOUNT]';
    const client = new Client({ config });
    const checkout = new CheckoutAPI(client);
        amount: { currency: "USD", value: 1000 },
        paymentMethod: {
            type: 'scheme',
            encryptedSecurityCode: "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
            encryptedExpiryMonth: "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
            encryptedExpiryYear: "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
            holderName: "S. Hopper",
            encryptedCardNumber: "adyenjs_0_1_18$MT6ppy0FAMVMLH..."
        billingAddress: {
            city: "Cupertino",
            country: "CA",
            houseNumberOrName: "1",
            postalCode: "95014",
            stateOrProvince: "CA",
            street: "Infinite Loop"
        reference: "YOUR_ORDER_NUMBER",
        merchantAccount: config.merchantAccount,
        returnUrl: ""
    }).then(res => res);

The /payments response contains:

  • pspReference: Our unique identifier for the transaction.
  • resultCode: Use this to present the payment result to your shopper.
  • merchantReference: The reference from the /payments request.
  • additionalData: Additional information about the transaction.
    To specify the fields that you want to receive in additionalData, log in to your Customer Area, and go to Developers > API URLs > Additional data settings.

/payments response
  "additionalData": {
    "cardSummary": "1111"
  "pspReference": "851572424333194G",
  "resultCode": "Authorised",
  "merchantReference": "YOUR_ORDER_NUMBER"

Present the payment result

Use the resultCode from the /payments response to present the payment result to your shopper. You will also receive the outcome of the payment asynchronously in a notification webhook.

For card payments, you can receive the following resultCode values:

resultCode Description Action to take
Authorised The payment was successful. Inform the shopper that the payment has been successful.
If you are using manual capture, you also need to capture the payment.
Cancelled The shopper cancelled the payment. Ask the shopper whether they want to continue with the order, or ask them to select a different payment method.
Error There was an error when the payment was being processed. For more information, check the refusalReason field. Inform the shopper that there was an error processing their payment.
Refused The payment was refused. For more information, check the refusalReason field. Ask the shopper to try the payment again using a different payment method.
Additional resultCode values are possible in case of the 3D Secure authentication flow. For more information, refer to Result codes.

Card brand recognition

When the shopper is entering their card details, the Component tries to recognize the card brand. When successful, the Component renders the brand icon and the corresponding input field for the card security code (CVC, CVV, or CID).

Co-branded cards

Co-branded cards issued in Europe are rendered by the Component according to the European regulatory guidelines (EU IFR Regulation 2015/751 article 8). This means that the Component renders all supported brands, and allows the cardholder to choose their preferred brand. This functionality is supported in version 3.18.2 and later.

Present debit and credit cards separately

In some scenarios, you may want to present your shoppers with separate payment forms for debit cards and credit cards. Some examples include:

  • In Brazil, many shoppers use Combo cards, allowing for both debit and credit transactions. Having a separate form for Debit Card and Credit Card gives your shoppers a clear indication of whether they are making a debit or credit transaction.
  • If you accept payments in Sweden, you need to present debit cards before credit cards in order to comply with local legislation.

For more details, see the corresponding sections about Brazil and Sweden.

Required versions

To present debit and credit cards separately in your Web Card Component integration, you need to use:

  • Checkout API v53 or later.
  • Web Components 3.9.5 or later.

Show the available debit and credit cards

  1. When you make a POST /paymentMethods request from your server, include: The following example shows how you would do this for a shopper in the Netherlands, making a 47.00 EUR payment.
    /paymentMethods request
    curl \
    -H "x-API-key: YOUR_X-API-KEY" \
    -H "content-type: application/json" \
    -d '{
      "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
      "countryCode": "NL",
      "amount": {
        "currency": "EUR",
        "value": 4700
      "splitCardFundingSources": true
    The response includes the list of available payment methods, with debit and credit cards split into separate objects.
       "paymentMethods": [
               "brands": [
               "fundingSource": "credit",
               "name": "Credit Card",
               "type": "scheme"
               "brands": [
               "fundingSource": "debit",
               "name": "Debit Card",
               "type": "scheme"
If your integration is set up correctly, the full /paymentMethods response is passed to the AdyenCheckout instance in your front end.
  1. In your front end, create two DOM elements and Card Component instances to show debit and credit cards separately.

    a. Create DOM elements for debit and credit cards, placing it where you want the forms to be rendered:

     <h1>Debit card</h1>
     <div id="debit-container"></div>
     <h1>Credit card</h1>
     <div id="credit-container"></div>

    b. Check if the /paymentMethods response returns objects that contain fundingSource debit and credit, then mount the instances.

    const debitCards = paymentMethodsResponse.paymentMethods.find(paymentMethod => paymentMethod.fundingSource === 'debit');
    if (debitCards) {
      checkout.create('card', debitCards).mount('#debit-container');
    const creditCards = paymentMethodsResponse.paymentMethods.find(paymentMethod => paymentMethod.fundingSource === 'credit');
    if (creditCards) {
       checkout.create('card', creditCards).mount('#credit-container');

When the shopper selects to pay with a debit or credit card, the selected Component works like any other Component—it calls the onChange or onSubmit event which contains a You can then use the to make a payment.


For debit transactions, we highly recommend using 3D Secure and Automatic Capture due to some issuers' restrictions.


When accepting payments in Sweden, present debit cards before credit cards, and label the forms clearly in order to comply with Swedish legislations.

Recurring payments

Adyen's tokenization service allows you to securely store shopper's card details for recurring payments. To make recurring payments, you first need to create a shopper token, and then use the token to make future payments for the shopper.

Create a token

To store shopper's card details, set enableStoreDetails to true when adding the Card Component. This will show a check box to your shopper for saving their card details for future payments.

If the shopper chooses to save their card details when making a payment, the onChange (or onSubmit) method from the Component will include a Pass this to your server.

To create a token, include in your /payments request:

  • storePaymentMethod: The from your front end.
  • shopperReference: Your unique identifier for the shopper.

Show a stored card in your payment form

To show a stored card payment in your payment form:

  1. Include in your /paymentMethods request:
  • shopperReference: The unique shopper identifier that you specified when creating the token.

The /paymentMethods response includes a storedPaymentMethods array containing the stored payment methods for this shopper.

Response with stored payment methods
       "holderName":"John Smith",
       "holderName":"John Smith",

When creating an instance of the AdyenCheckout, pass the full /paymentMethods response to the paymentMethodsResponse object .

  1. Add stored cards to your payment form:
    a. Create a DOM element for stored payment methods, placing it where you want the form to be rendered:
    <div id="stored-card"></div>
    b. Get the stored payment method that you want to display from the checkout.paymentMethodsResponse object, and pass this when creating an instance of the Card Component:
    const storedPaymentMethod = checkout.paymentMethodsResponse.storedPaymentMethods[0];
    const card = checkout.create("card", storedPaymentMethod).mount("#stored-card");
To configure how the stored card renders in your payment form, refer to Configuring the Component.

When the shopper selects to pay, the Component calls the onChange event, which contains a If state.isValid is true, collect the and pass this to your server. You'll need this to make a payment.

Make a payment with a token

When the shopper selects to pay, the Component calls the onChange event, which contains a

  1. Pass the to your server.
  2. From your server, make a /payments request, specifying:
    • paymentMethod: The from the onChange event.
      • shopperReference: The unique shopper identifier that you specified when creating the token.
      • shopperInteractionContAuth.
      • recurringProcessingModel: CardOnFile.
      Payment request with a token
      curl \
      -H "X-API-key: [Your API Key here]" \
      -H "Content-Type: application/json" \
      -d '{

The /payments response contains:

   "pspReference": "8815329842815468",
   "resultCode": "Authorised"

You can also use tokens to make shopper-not-present payments for subscriptions or contracts. For more information, refer to Making a payment for a subscription or contract.

Test and go live

Before making live card payments:

  1. Test your integration using our test card numbers. You can check the status of test payments in your Customer Area > Transactions > Payments.
    If you want to test API calls but your client-side integration is not yet ready, add a test_ prefix to the test card credentials. Refer to test with encrypted card details.
  2. Add the cards that you want to accept in your live Customer Area.
  1. Before you can start accepting card payments in the live environment, you need to assess your PCI DSS compliance and submit the required Self-Assessment Questionnaire A document. For more information, refer to PCI DSS compliance guide.

See also