Are you looking for test card numbers?

Would you like to contact support?

Payment-method icon

Card Component

Add card payments to your existing Components integration.

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

Before you begin

This page explains how to add cards to your existing Android Components integration. The Android 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 integration:

  1. Make sure that you have set up your back end implementation for making API requests.
  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, you need to:

  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. Deserialize the /paymentMethods response, and get the object with type: scheme.
    For showing stored cards, get the object with type: storedPaymentMethods.

  3. Add the Card Component:

    a. Import the Card Component to your build.gradle file.

      implementation "com.adyen.checkout:card-ui:<latest-version>"

    For the latest version, refer to our GitHub.

    b. Create a cardConfiguration object, and pass your Client Encryption Public Key.

    To get your Client Encryption Public Key:

    1. Sign in to your Customer Area using your company-level account.
    2. Navigate to Account > Users.
    3. Click on your web service user (ws@Company.[YourCompanyAccount]) in the users list.
      This opens the Edit Web Service User page.
    4. In the Client-Side Encryption panel, copy the Client Encryption Public Key.
       val cardConfiguration =
        CardConfiguration.Builder(context, "<publicKey>")
            // When you're ready to accept live payments, change the value to one of our live environments.

    c. Initialize the Card Component. Pass the object from the /paymentMethods response and the cardConfiguration object.

    val cardComponent = CardComponent.PROVIDER.get(this@YourActivity, paymentMethod, cardConfiguration)

    d. Add the Card Component view to your layout.


    e. Attach the Component to the view to start getting your shopper's payment details.

       cardView.attach(cardComponent, this@YourActivity)

    f. When shoppers enter their payment details, you start receiving updates. If isValid is true and the shopper proceeds to pay, pass the to your server and make a payment request.

    cardComponent.observe(this@MainActivity, Observer {
      if (it?.isValid == true) {
          // When the shopper proceeds to pay, pass the `` to your server to send a /payments request

Make a payment

When the shopper proceeds to pay, the Component returns the

  1. Pass the to your server.
  2. From your server, make a /payments request, specifying:

    • paymentMethod: The from your client app.

curl \
-H "X-API-key: [Your API Key here]" \
-H "Content-Type: application/json" \
-d '{
 "amount": {
   "currency": "USD",
   "value": 1000
 "reference": "YOUR_ORDER_NUMBER",
 "{ from app}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"
 "returnUrl": "adyencheckout://",
 "merchantAccount": "YOUR_MERCHANT_ACCOUNT"
# 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"
  :returnUrl => "",
  :merchantAccount => "YOUR_MERCHANT_ACCOUNT"
// Set your X-API-KEY with the API key from the Customer Area.
Client client = new Client(xApiKey,Environment.TEST);
Checkout checkout = new Checkout(client);
PaymentsRequest paymentsRequest = new PaymentsRequest();
Amount amount = new Amount();
String encryptedCardNumber = "adyenjs_0_1_18$...encryptedCardNumber";
String encryptedExpiryMonth = "adyenjs_0_1_18$...encryptedExpiryMonth";
String encryptedExpiryYear = "adyenjs_0_1_18$...encryptedExpiryYear";
String encryptedSecurityCode = "adyenjs_0_1_18$...encryptedSecurityCode";
paymentsRequest.addEncryptedCardData(encryptedCardNumber,encryptedExpiryMonth, encryptedExpiryYear, encryptedSecurityCode, "S. Hopper");
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"
  "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': {
      'value': 1000,
      'currency': 'USD'
   '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'
   '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 amount = new Model.Checkout.Amount("USD", 1000);
var details = new Model.Checkout.DefaultPaymentMethodDetails{
  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..."
var paymentsRequest = new Model.Checkout.PaymentRequest
  Reference = "YOUR_ORDER_NUMBER",
  Amount = amount,
  ReturnUrl = @"",
  MerchantAccount = "YOUR_MERCHANT_ACCOUNT",
  PaymentMethod = details

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();
// Set your X-API-KEY with the API key from the Customer Area.
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..."
    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 Account > API URLs > Additional data settings.

  "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 request that they 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.

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

When a shopper chooses to pay with card, the Card Component renders a switch for saving the card details for future payments. If a shopper selects this option, the paymentComponentState from the Component will include data.storePaymentMethod. Pass this to your server.

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

  • storePaymentMethod: The from your client app.
  • shopperReference: Your unique identifier for the shopper.

If you don't want to show the switch for saving card details, set showStoredPaymentMethods to false when creating the cardConfiguration object:

val cardConfiguration = CardConfiguration.Builder(context, "<publicKey>")

Show a stored card in your payment form

If a shopper has stored their card, and if you pass the shopperReference in the /paymentMethods request, the /paymentMethods response will contain an object with type: storedPaymentMethods.

To show the stored card in your payment form, pass this object when initializing the Component.

Make a payment with a token

When using a stored card, the shopper needs to enter their card security code to complete the payment. The security code will be included in the that you need when making the payment request. For more information, refer to Making payments with tokens.

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.
  2. Add the cards that you wish to accept in your live Customer Area.
  1. Configure the Component using the Client Encryption Public Key from your live Customer Area.

See also