In-app quick integration

Adyen provides you with a solution to simplify the way you integrate your iOS or Android app with our payment platform. You can use the same integration for payments made with cards (optionally with 3D Secure), mobile wallets, and local payment methods (e.g. iDEAL and Sofort). Use our SDKs and server-side Checkout API to get a head start with accepting in-app payments and benefit from the fully optimized UI out-of-the-box.

In case you already integrated your mobile app with Adyen using client-side encryption and need to access the previous version of this documentation, refer to In-app integration using CSE.

In addition, we offer advanced users, who are PCI DSS compliant at level 1 or 2, the possibility to integrate directly with our payments API without using the SDKs and Checkout API. For detailed steps on this, refer to API integration.

Prerequisites

Before you start integrating your mobile app with Adyen, make sure that you have performed the following steps:

  1. Sign up for an Adyen test account at https://www.adyen.com/signup. For more information, refer to Getting started with Adyen.
  2. Create a web service user and obtain a Checkout API key to connect to the Checkout API. For details, see How to get the Checkout API key.

Integration overview

The checkout flow requires you to perform the following steps:

  1. When the shopper starts the checkout process, the SDK wraps the payment configuration into a token object and passes it to your app. 
  2. Then you forward this token to your server that makes the /setup call to the Checkout API. 
  3. In response you receive the list of available payment methods that you forward through your server and the app to the Checkout SDK.
  4. Next, the SDK presents the UI (or your own app handles the UI in case of custom integration). After the shopper has selected a payment method and provided the payment details, the SDK authorises the payment method directly with Adyen. 
  5. Finally, the app should send the payload through your server to the Checkout API to verify the payment result. This ensures that both your server and the app know the final authorisation response of the payment.

This integration is split into native mobile (iOS SDK & Android SDK) and backend (Checkout API) implementation steps. We provide you with a demo server, so you can start integrating the SDK before implementing your own server:
https://checkoutshopper-test.adyen.com/checkoutshopper/demoserver/

Always switch from our demo server to your own server implementation and test it before going live.

Which mobile platform are you using?

 

Implement your server

On your server, implement two calls (setup and verify) to the Checkout API and expose two corresponding endpoints to communicate with the implemented methods from the SDK. Until going live, you can use the Adyen demo server as explained in Integration overview.

For security reasons you have to make sure the app (user) is authenticated on your server. For example, we advise using OAuth 2.0 for the authentication.

Obtain payment methods

To obtain payment methods, submit the relevant payment data to the  /setup endpoint. For information on required data fields, refer to Checkout API Reference.

In addition, you can submit more data fields, such as additional information about the shopper, risk data, airline data. See the full API reference for everything you can add.

The example below demonstrates how to send a (JSON) POST request containing your API key in the x-api-key header.

curl \
-H "Content-Type: application/json" \
-H "X-API-Key: Checkout_API_key" \
-X POST \
-d '{
      "amount": {
        "currency": "EUR",
        "value": "17408"
      },
      "reference": "Your order number",
      "merchantAccount": "YOUR_MERCHANT_ACCOUNT_NAME",
      "shopperReference": "john@test.com",
      "channel": "Android",
      "token": "2he28Ddhwj24HHwed72hwj24HHwdbw",
      "returnUrl": "app://",
      "countryCode": "NL",
      "shopperLocale": "nl_NL",
      "sessionValidity": "2017-04-06T13:09:13Z"
    }' \
https://checkout-test.adyen.com/services/PaymentSetupAndVerification/v31/setup

The call to /setup is where the actual payment session starts. If your app already contains data like the amount and reference, validate this data on your server before sending it to the Checkout API. This way, you make sure the shopper cannot tamper with any of the transaction data.

After making this call you receive a response in JSON format. Transfer this response to your mobile application, which then should pass it to the SDK as shown in the Integrate SDK section.

Verify payment result

After the payment method is authorised, you should send the payload that you received back from the SDK to your server. Then your server has to send the payload to the /verify endpoint, so you can verify the payment result.

The example below demonstrates how to send a (JSON) POST request containing your API key in the x-api-key header.

curl \
-H "Content-Type: application/json" \
-H "X-API-Key: Checkout_API_key" \
-X POST \
-d '{ "payload": "2he28Ddhwj242he28Ddhwj24HHw2he28Ddhwj24HHwed72hwj24HHwdbwed72h2he28Ddhwj24HHwed72hwj24HHwdbwwj24HHwdbw" }' \
https://checkout-test.adyen.com/services/PaymentSetupAndVerification/v31/verify

Response:

{
  "authResponse": "Authorised",
  "merchantReference": "merchant reference",
  "pspReference": "8514964093470284"
}

For more information on required data fields, refer to Checkout API Reference.

Next steps

Integrated the SDK, got your own server up and running, and processed the first payment on our test platform successfully? Congratulations, you are almost ready to go live.

Before doing so, make sure to:

  • If necessary, expand your implementation and design your own checkout UI while leveraging the underlying functionality of the SDK. For more information, refer to Custom integration.
  • Implement notifications, as this covers edge cases like a lost Internet connection on the mobile device during the authorisation process. For more information, refer to Payment notifications.
  • Apply for a live account by providing the relevant KYC data to Adyen. For more information, refer to Get started with Adyen.

Questions

Can't find something you are looking for? Look at our FAQ for answers or contact Support.