Search

Are you looking for test card numbers?

Would you like to contact support?

Payment-method icon

Raw card data

Accept card payments submitting raw card data.

Use our APIs to accept card payments with raw card data, and build your own UI to have full control over the look and feel of your checkout page.

To collect raw card data, you need to be PCI Level 1 or 2 certified. If you're not PCI Level 1 or 2 certified, use the Custom Card Component, or one of our client-side solutions instead.

Before you begin

These instructions explain how to add card payments to your existing API-only integration. The API-only integration works the same way for all payment methods. If you haven't done this integration yet, refer to our API-only integration guide.

Before starting your integration:

  1. Make sure that you have set up your back end implementation.
  2. Add the cards that you want to support in your test Customer Area.

Build your payment form for cards

When making a card payment, collect the following shopper details:

Card details Example input Required
The card number "4111111111111111" -white_check_mark-
The card expiry month "03" -white_check_mark-
The card expiry year "30" -white_check_mark-
The security code (CVV / CVC) "737" -white_check_mark-
The card holder's name "S.Hopper"

We provide logos for cards, which you can use on your payment form. For more information, refer to Downloading logos.

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

You can also get the required input fields and a list of supported brands from the /paymentMethods response, when specifying a valid combination of countryCode and amount.currency.

The supported brands and the required input fields are included in the object with type: scheme.

For more information, refer to our API-only integration guide.

Make a payment

From your server, make a/payments request, specifying:

  • paymentMethod.typescheme.
  • paymentMethod.number: The card number (without separators).
  • paymentMethod.expiryMonth: The card expiry month.
  • paymentMethod.expiryYear: The card expiry year.
  • paymentMethod.cvc: The card verification code.
  • paymentMethod.holderName: (optional) The card holder's name.

curl https://checkout-test.adyen.com/v50/payments \
-H "X-API-key: [Your API Key here]" \
-H "Content-Type: application/json" \
-d '{
    "amount": {
      "currency": "USD",
      "value": 1000
    },
    "reference": "YOUR_ORDER_NUMBER",
    "paymentMethod": {
      "type": "scheme",
      "number": "4111111111111111",
      "expiryMonth": "10",
      "expiryYear": "2020",
      "cvc": "737",
      "holderName": "S.Hopper"
    },
    "returnUrl": "https://your-company.com/...",
    "merchantAccount": "YOUR_MERCHANT_ACCOUNT"
  }'
# Set your X-API-KEY with the API key from the Customer Area.
adyen = Adyen::Client.new
adyen.api_key = "YOUR_X-API-KEY"
 
response = adyen.checkout.payments({
  :amount => {
    :currency => "USD",
    :value => 1000
  },
  :reference => "YOUR_ORDER_NUMBER",
  :paymentMethod => {
    :type => "scheme",
    :number => "4111111111111111",
    :expiryMonth => "10",
    :expiryYear => "2020",
    :cvc => "737",
    :holderName => "S. Hopper"
  },
  :returnUrl => "https://your-company.com/...",
  :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();
paymentsRequest.setMerchantAccount("YOUR_MERCHANT_ACCOUNT");
Amount amount = new Amount();
amount.setCurrency("USD");
amount.setValue(1000L);
paymentsRequest.setAmount(amount);
String number = "4111111111111111";
String expiryMonth = "10";
String expiryYear = "2020";
String cvc = "737";
String holderName = "John Smith";
paymentsRequest.setReference("YOUR_ORDER_NUMBER");
paymentsRequest.addCardData(number,expiryMonth, expiryYear, cvc, holderName);
paymentsRequest.setStorePaymentMethod(true);
paymentsRequest.setReturnUrl("https://your-company.com/...");
PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);
// Set your X-API-KEY with the API key from the Customer Area.
$client = new \Adyen\Client();
$client->setXApiKey("YOUR_X-API-KEY");
$service = new \Adyen\Service\Checkout($client);

$params = array(
  "amount" => array(
    "currency" => "USD",
    "value" => 1000
  ),
  "reference" => "YOUR_ORDER_NUMBER",
  "paymentMethod" => array(
    "type" => "scheme",
    "number" => "4111111111111111",
    "enxpiryMonth" => "10",
    "expiryYear" => "2020",
    "cvc" => "737",
    "holderName" => "S. Hopper"
  ),
  "returnUrl" => "https://your-company.com/...",
  "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',
      'number': '4111111111111111',
      'expiryMonth': '10',
      'expiryYear': '2020',
      'cvc': '737',
      'holderName': 'S. Hopper'
   },
   'returnUrl': 'https://your-company.com/checkout/',
   '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",
  number = "4111111111111111",
  expiryMonth = "10",
  expiryYear = "2020",
  cvc = "737"
};
var paymentsRequest = new Model.Checkout.PaymentRequest
{
  Reference = "YOUR_ORDER_NUMBER",
  Amount = amount,
  ReturnUrl = @"https://your-company.com/...",
  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 });
client.setEnvironment("TEST");
const checkout = new CheckoutAPI(client);
checkout.payments({
    amount: { currency: "USD", value: 1000 },
    paymentMethod: {
        type: 'scheme',
        number: "4111111111111111",
        expiryMonth: "10",
        expiryYear: "2020",
        cvc: "737",
        holderName: "S.Hopper"
    },
    reference: "YOUR_ORDER_NUMBER",
    merchantAccount: config.merchantAccount,
    returnUrl: "https://your-company.com/..."
}).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

To store shopper's card details, include in your /payments request:

  • storePaymentMethod: true
  • shopperReference: Your unique identifier for the shopper.

The /payments response contains:

  • recurringDetailReference: This is the token that you'll need to make recurring payments for this shopper.
The recurringDetailReference is also contained in the AUTHORISATION notification that you will receive for this payment.

Show a stored card in your payment form

To get the stored payment methods for a shopper, include in your /paymentMethods request:

  • shopperReference: The unique shopper identifier that you specified when creating the token.

The /paymentMethods response will include a storedPaymentMethods array that contains all the stored payment methods for this shopper.

         {
         ...
         "storedPaymentMethods":[
             {
                "brand":"visa",
                "expiryMonth":"10",
                "expiryYear":"2020",
                "holderName":"John Smith",
                "id":"8415718415172204",
                "lastFour":"1111",
                "name":"VISA",
                "supportedShopperInteractions":[
                   "Ecommerce",
                   "ContAuth"
                ],
                "type":"scheme"
             },
             {
                "brand":"visa",
                "expiryMonth":"08",
                "expiryYear":"2018",
                "holderName":"John Smith",
                "id":"8315720121476805",
                "lastFour":"0008",
                "name":"VISA",
                "supportedShopperInteractions":[
                   "ContAuth",
                   "Ecommerce"
                ],
                "type":"scheme"
             }
]
         ...
         }

Make a payment with a token

To make a payment with the token, include in your /payments request:

  • paymentMethod.storedPaymentMethodId: the id from the the /paymentMethods. This is the recurringDetailReference that you received when creating the token.

You can use tokens to make:

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.

See also