Search

Are you looking for test card numbers?

Would you like to contact support?

Online-payment icon

API-only integration guide

Learn how you can use our APIs and then build your own UI.

Use our APIs and build your own payment form if you want full control over the look and feel of your checkout page. If you'd rather not build your own payment form and would like to use our available UI solutions for web, iOS, and Android, see Drop-in or Components.

To start your online payments integration, you need to implement API calls from your server and then build your client-side implementation:

  1. From your server, submit a request to get a list of payment methods available to the shopper.
  2. Present your payment form and collect your shopper's payment details.
  3. From your server, submit a payment request with the data you have collected from the shopper.
  4. Check from the response if you need to perform additional actions on your front end. For example, redirecting your shopper to another website to complete the payment.
  5. From your server, submit additional payment details.
  6. Present the payment result to your shopper.

Before you begin

Before you start integrating with our online payments API, make sure that you have performed the following steps:

  1. Contact our Sales Support to make sure you're eligible for using our API-only integration.
  2. Sign up for an Adyen test account.
  3. Get your API Key. Save a copy as you need it for API calls you make to the Adyen payments platform.
  4. Install one of our Libraries to connect with the Adyen APIs.
  5. Use the latest version of our APIs.
  6. If you're building for multiple merchants, provide some basic information so that we can offer you better support.

For more information on these steps, refer to Get started with Adyen.

Step 1: Get available payment methods

  1. Make a POST /paymentMethods request, providing:

    • merchantAccount: Your merchant account name. 
    • countryCode: The shopper's country.
    • amount: The currency and value of the payment. 
    • channel: The platform of the shopper's device. Specify either Android, iOS, or Web.

    We use the countryCodeamount, and channel to tailor the list of payment methods to your shopper.

    curl https://checkout-test.adyen.com/v50/paymentMethods \
    -H "x-API-key: YOUR_X-API-KEY" \
    -H "content-type: application/json" \
    -d '{
      "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
      "countryCode": "NL",
      "amount": {
        "currency": "EUR",
        "value": 1000
      },
      "channel": "Web"
    }'
    # 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.payment_methods({
      :merchantAccount => 'YOUR_MERCHANT_ACCOUNT',
      :countryCode => 'NL',
      :amount => {
        :currency => 'EUR',
        :value => 1000
      },
      :channel => 'Web'
    })
    // 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);
    PaymentMethodsRequest paymentMethodsRequest = new PaymentMethodsRequest();
    paymentMethodsRequest.setMerchantAccount("YOUR_MERCHANT_ACCOUNT");
    paymentMethodsRequest.setCountryCode("NL");
    Amount amount = new Amount();
    amount.setCurrency("EUR");
    amount.setValue(1000L);
    paymentMethodsRequest.setAmount(amount);
    paymentMethodsRequest.setChannel(PaymentMethodsRequest.ChannelEnum.WEB);
    PaymentMethodsResponse response = checkout.paymentMethods(paymentMethodsRequest);
    // 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(
      "merchantAccount" => "YOUR_MERCHANT_ACCOUNT",
      "countryCode" => "NL",
      "amount" => array(
        "currency" => "EUR",
        "value" => 1000
      ),
      "channel" => "Web"
    );
    $result = $service->paymentMethods($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.payment_methods({
      'merchantAccount': 'YOUR_MERCHANT_ACCOUNT',
      'countryCode': 'NL',
      'amount': {
        'value': 1000,
        'currency': 'EUR'
      },
      'channel': 'Web',
    })
    // 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("EUR", 1000);
    var paymentMethodsRequest = new Model.Checkout.PaymentMethodsRequest(MerchantAccount: "YOUR_MERCHANT_ACCOUNT")
    {
       CountryCode = "NL",
       Amount = amount,
       Channel = "Web"
    };
    const config = new Config();
    // Set your X-API-KEY with the API key from the Customer Area.
    config.apiKey = '[API_KEY]';
    config.merchantAccount = '[MERCHANT_ACCOUNT]';
    const client = new Client({ config });
    client.setEnvironment("TEST");
    const checkout = new CheckoutAPI(client);
    const paymentsResponse = checkout.paymentMethods({
        amount: {
            currency: "EUR",
            value: 1000,
        },
        countryCode: "NL",
        channel: "Web",
        merchantAccount: config.merchantAccount
    }).then(res => res);

    From the response you get a list of available paymentMethods, including:

    • name: Name of the payment method, which you can display to your shopper in your checkout page. 
    • type: Unique payment method code.
    • details: An array that contains the required fields for each payment method.
    {
      "paymentMethods":[
        {
          "details": [
            {
              "key": "number",
              "type": "text"
            },
            {
              "key": "expiryMonth",
              "type": "text"
            },
            {
              "key": "expiryYear",
              "type": "text"
            },
            {
              "key": "cvc",
              "type": "text"
            },
            {
              "key": "holderName",
              "optional": true,
              "type": "text"
            }
          ],
          "name": "Credit Card",
          "type": "scheme"
        },
        {
          "details":[
            {
              "key":"sepa.ownerName",
              "type":"text"
            },
            {
              "key":"sepa.ibanNumber",
              "type":"text"
            }
          ],
          "name":"SEPA Direct Debit",
          "type":"sepadirectdebit"
        },
        {    ...
        }
      ]
    }
  2. Get the required fields for each payment method from the details array. If a payment method does not have a details array, you do not need to collect any shopper details in your form.

    • key: The information that you need to collect from the shopper.
    • type: The input type.

      Type Description
      emailAddress Email address.
      radio Radio buttons displaying the options specified within the items array.
      select A list displaying the options specified within the items array. Present each name in this array to the shopper.
      tel Telephone number.
      text Generic string. For "type": "scheme", if you are PCI Level 1 or 2 certified you can alternatively collect and submit raw card data. Otherwise, you need to generate encrypted card data using our Custom Card Component.

    For example, to pay with name SEPA Direct Debit:

    {
      "paymentMethods":[
        {
          ...
        },
        {
          "details":[
            {
              "key":"sepa.ownerName",
              "type":"text"
            },
            {
              "key":"sepa.ibanNumber",
              "type":"text"
            }
          ],
          "name":"SEPA Direct Debit",
          "type":"sepadirectdebit"
        }
      ]
    }

    The details.type property indicates that you need text fields to collect the following details.key fields:

    • sepa.ownerName: Name on the shopper's bank account.
    • sepa.ibanNumber: IBAN number of this account.

  3. Provide the list of payment methods and the required input fields to your front end or client app.

Step 2: Collect shopper details

For your payment form, you can build either:

  • A hard-coded payment form: After making a /paymentMethods call in step 1 to determine the payment details you need to collect, you build a static form that collects them from the shopper.

    A hard-coded form is quicker to implement, but the payment details you need to collect from a shopper can change. You should regularly poll the /paymentMethods endpoint to check for any updates to required payment details. We recommend this approach if you're only working with a small number of payment methods or countries.

  • Or a dynamically generated payment form: For each transaction, you make a /paymentMethods call in step 1 to determine the payment details you need to collect.

    Then use the response to generate a form that collects them from the shopper. This takes more time to implement, but ensures that the required payment details you collect from the shopper are up-to-date.

To present the list of payment methods to your shoppers and collect their payment details:

  1. Show the available payment methods to your shopper. You can get the available payment methods using the name parameter from the /paymentMethods response.

    If you need payment method and issuer logos for your payment form, see Downloading logos for more information.

  2. After the shopper selects a payment method, render the required input fields based from the details array from the /paymentMethods response and collect the shopper's payment details. If the shopper selects a payment method without a details array, proceed to step 3.

    If the shopper selects to pay with a Card payment method, see your options on how to collect your shopper's card payment details.

  3. Pass the data you have collected from your shopper and the payment method type to your server.

    For example:

    {
      "type": "sepadirectdebit",
      "sepa.ownerName": "A Schneider",
      "sepa.ibanNumber": "NL13TEST0123456789"
    }

Collecting your shopper's card details

If the shopper selects to pay with a Card payment method, you have the following options for collecting card details:

After you have collected your shopper's raw card details or you have received the encrypted details from the Custom Card fields component, pass the data along with type: scheme to your server and proceed to step 3.

  {
      "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"
  }

Step 3: Make a payment

  1. Make a POST /payments request specifying:

    Additional parameters are required for some payment methods, native 3D Secure 2 authentication, and recurring payments. For information on the required fields, refer to the payment method integration guides.
    • amount
    • reference: Your unique reference for this payment.
    • paymentMethod: The shopper payment details you have collected from the previous step and the payment method type.
    • returnUrl: URL to where the shopper should be taken back to after a redirection. This is used for payment methods that require redirection to issuer's website, such as iDEAL, or in a 3D Secure authentication flow.

      • For Web, the URL should include the protocol: http:// or https://. You can also include your own additional query parameters, for example, shopper ID or order reference number.
      • For iOS, use the custom URL for your app. For example, my-app://. For more information on setting custom URL schemes, refer to the Apple Developer documentation.
      • For Android, use a custom URL handled by an Activity on your app. You can configure it with an intent filter. For example, configure my-app://your.package.name, and then add that to your manifest.xml file.

        <activity
          android:name=".YourActivity">
            <intent-filter>
              <action android:name="android.intent.action.VIEW"/>
        
              <category android:name="android.intent.category.DEFAULT"/>
              <category android:name="android.intent.category.BROWSABLE"/>
        
              <data
                android:host="${applicationId}"
                android:scheme="my-app"/>
           </intent-filter>
        </activity>

    curl https://checkout-test.adyen.com/v50/payments \
    -H "x-API-key: YOUR_X-API-KEY" \
    -H "content-type: application/json" \
    -d '{
      "amount":{
        "currency":"EUR",
        "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":"https://your-company.com/checkout?shopperOrder=12xy..",
      "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 => "EUR",
        :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 => "https://your-company.com/checkout?shopperOrder=12xy..",
      :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("EUR");
    amount.setValue(15000L);
    paymentsRequest.setAmount(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.setReference("Your order number");
    paymentsRequest.addEncryptedCardData(encryptedCardNumber,encryptedExpiryMonth, encryptedExpiryYear, encryptedSecurityCode, "S. Hopper");
    paymentsRequest.setReturnUrl("https://your-company.com/checkout?shopperOrder=12xy..");
    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" => "EUR",
        "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" => "https://your-company.com/checkout?shopperOrder=12xy..",
      "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': 'EUR'
       },
       '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': 'https://your-company.com/checkout?shopperOrder=12xy..',
       '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("EUR", 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 = @"https://your-company.com/checkout?shopperOrder=12xy..",
      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: "EUR", 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: "https://your-company.com/checkout?shopperOrder=12xy.."
    }).then(res => res);

    Depending on the payment result, you'll receive a response containing:

    • resultCode: Provides information about the result of the request.
    • pspReference: Our unique identifier for the transaction.
    • details: This array shows the fields that you need to pass in your next request.
    • action: If you receive this object, this indicates that you need to perform an additional action on your front end to complete the payment. The type field specifies the required action. Possible values are:

      • qrCode
      • redirect
      • threeDS2Fingerprint
      • threeDS2Challenge
      • voucher
    • action.paymentData: Keep a copy of the paymentData. You will need this in your next request.

  2. The next steps depend on if you received an action object in the response.

    • If you received an action object, pass this to your front end or client app and proceed to step 4.
    • If you did not get an action object, proceed to step 6 to present the payment result to your shopper.
    {
       "additionalData": {
           "sepadirectdebit.sequenceType": "OneOff",
           "sepadirectdebit.dateOfSignature": "2019-06-04",
           "sepadirectdebit.mandateId": "851559658348924K",
           "merchantReference": "TEST"
       },
       "pspReference": "851559658348924K",
       "resultCode": "Received"
    }
    {
      "resultCode": "RedirectShopper",
      "action": {
          "method": "POST",
          "paymentData": "Ab02b4c0!BQABAgCW5sxB4e/==",
          "paymentMethodType": "scheme",
          "type": "redirect",
          "url": "https://test.adyen.com/hpp/3d/validate.shtml",
          "data": {
            "PaReq": "eNpVUslygkAQ/RXjB8yCgEi1kyJSq..",
            "TermUrl": "https://your-company.com/...",
            "MD": "ejJydDdDeExyVUFrTEFaMTlITCt_..."
          }
      },
      "details": [
          {
              "key": "MD",
              "type": "text"
          },
          {
              "key": "PaRes",
              "type": "text"
          }
      ],
      "paymentData": "Ab02b4c0!BQABAgCW5sxB4e/=="
    }

Step 4: Perform additional actions

If your server received an action object in the /payments response, your next steps will depend on the action.type: presenting a voucher or QR code, redirecting shoppers to another website, or performing 3D Secure 2 native authentication.

Present a voucher

If you get a voucher action.type:

  1. Get the voucher data from the action object and present this information on your front end or client app.

    For example, for Indonesian bank transfer payments, you get the following fields in the response:

    • expiresAt: The voucher expiry date.
    • initialAmount object: The amount and currency that the shopper has to pay.
    • merchantName: Your shop's name.
    • instructionsUrl: Link to where a shopper can get additional information about how to pay.
    {
    "resultCode": "PresentToShopper",
    "action": {
        "expiresAt": "2019-09-04T19:17:00",
        "initialAmount": {
            "currency": "IDR",
            "value": 10000
        },
        "instructionsUrl": "https://checkoutshopper-test.adyen.com/checkoutshopper/voucherInstructions.shtml?txVariant=doku_mandiri_va",
        "merchantName": "YOUR_SHOP_NAME",
        "paymentMethodType": "doku_alfamart",
        "reference": "8520126030105485",
        "shopperEmail": "john.smith@adyen.com",
        "shopperName": "John Smith",
        "totalAmount": {
            "currency": "IDR",
            "value": 10000
        },
        "type": "voucher"
    }
    }
  2. After you present the voucher to the shopper, proceed to step 6 and inform the shopper that you are waiting for the payment. We'll send a notification webhook to inform you of the payment result.

Present a QR code

If you get a qrCode action.type:

  1. Get the qrCodeData from the action object. This parameter contains a URL that renders the QR code.

    For example, for WeChat Pay desktop QR payments, you get the following in the response:

    {
    "resultCode": "PresentToShopper",
    "action": {
        "paymentData": "Ab02b4c0!BQAB..",
        "paymentMethodType": "wechatpayQR",
        "qrCodeData": "weixin://wxpay/bizpayurl?pr=IM7BCOW",
        "type": "qrCode"
    }
    ...
    }
  2. Present the QR code on your checkout page.
  3. After the shopper scans the QR code and completes the payment, we'll send a notification webhook informing you of the payment result.
  4. Proceed to step 6 to present the payment result.

Redirect shopper to another website

If you get a redirect action.type:

Get the 3D Secure 2 device fingerprint or present the challenge flow

If you get a threeDS2Fingerprint or threeDS2Challenge action.type:

Step 5: Submit additional payment details

If you redirected your shopper to another website or presented a QR code, use the /payments/details endpoint to check the payment result. If you performed 3D Secure 2 native authentication, you need to use the same endpoint to submit authentication results and to complete the payment.

  1. From your server, make a POST /payments/details request specifying:

    • details: This object should contain the details.key parameters you received in the /payments response. Pass the redirect parameters from when the shopper returned to your website or the parameters from the 3D Secure 2 Component.
    • paymentData: This is the paymentData you received in the /payments response.

    For example, if you received the payload parameter when the shopper was redirected back to your website, then you need to submit your request:

    curl https://checkout-test.adyen.com/v50/payments/details \
    -H "x-API-key: YOUR_X-API-KEY" \
    -H "content-type: application/json" \
    -d '{
         "paymentData":"Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...",
         "details":{
           "payload":"Ab02b4c0!BQABAgCW5sxB4e/=="
         }
    }'
    # 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.details({
      :paymentData => 'Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...',
      :details => {
        :payload => 'Ab02b4c0!BQABAgCW5sxB4e/=='
      }
    })
    // 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);
    PaymentDetailsRequest paymentDetailsRequest = new PaymentDetailsRequest();
    HashMap<String, String> details = new HashMap<>();
    details.put("payload", "Ab02b4c0!BQABAgCW5sxB4e/==...");
    paymentsDetailsRequest.setDetails(details);
    paymentsDetailsRequest.setPaymentData("Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...");
    PaymentsResponse paymentsResponse = checkout.paymentDetails(PaymentDetailsRequest);
    // 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(
      "paymentData" => "Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...",
      "details" => array(
        "payload" => "Ab02b4c0!BQABAgCW5sxB4e/==..."
      )
    );
    $result = $service->paymentDetails($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_details({
       'paymentData' : 'Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...',
       'details': {
          'payload': 'Ab02b4c0!BQABAgCW5sxB4e/=='
       }
    })
    // 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 details = new Dictionary<string, string>
    {
      { "payload", "Ab02b4c0!BQABAgCW5sxB4e/==..." }
    };
    var paymentsDetailsRequest = new Model.Checkout.PaymentsDetailsRequest(Details: details);
    var paymentResponse = checkout.PaymentDetails(paymentsDetailsRequest);
    // 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 = '[MERCHANT_ACCOUNT]';
    const client = new Client({ config });
    client.setEnvironment("TEST");
    const checkout = new CheckoutAPI(client);
    checkout.paymentsDetails({
        details: { payload: "Ab02b4c0!BQABAgCW5sxB4e/==" },
        paymentData: "Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...",
    }).then(res => res);

    Depending on the payment result, you'll receive a response containing:

    • resultCode: Provides information about the result of the request.
    • pspReference: Our unique identifier for the transaction.
    • action: If you receive this object, this indicates that you need to perform step 4 again.

  2. The next steps depend on if you received an action object in the response.
    • If you received an action object, pass this to your front end or client app and perform step 4 again.
    • If you did not get an action object, proceed to the next step to present the payment result to your shopper.

Step 6: Present payment result

After the shopper completes the payment and no more further actions are required on the front end or client app, use the resultCode to inform the shopper of the payment status.

resultCode Description
Authorised The payment was successful.
Error Inform the shopper that there was an error processing their payment. This result code is returned with a refusalReason, indicating the cause of the error.
Pending The shopper has completed the payment but the final result is not yet known. Inform the shopper that you've received their order, and are waiting for the payment to be completed. You will receive the final result of the payment in an AUTHORISATION notification.
PresentToShopper For a voucher payment method, inform the shopper that you are waiting for their payment. You will receive the final result of the payment in an AUTHORISATION notification.

For a qrCode payment method, wait for the AUTHORISATION notification before presenting the payment result to the shopper.
Refused Inform the shopper that the payment was refused. Ask the shopper to try the payment again using a different payment method or card.
Received Inform the shopper that you've received their order, and are waiting for the payment to clear. You will receive the final result of the payment in an AUTHORISATION notification.

For other possible resultCode values and recommended messages that you can present to your shopper, see Result codes.

Test and go live

Before going live, use our list of test cards and other payment methods to test your integration. We recommend testing each payment method that you intend to offer to your shoppers.

You can check the status of a test payment in your Customer Area, under TransactionsPayments.

When you are ready to go live, you need to:

  1. Apply for a live account.
  2. Configure your live account
  3. Submit a request to add payment methods in your live Customer Area .
  4. Switch from test to our live endpoints.

See also

Next steps