Libraries

Adyen provides server-side libraries in several languages. We put the source for all our libraries, as well as example integrations, on our GitHub.

PHP

Requirements

  • PHP 5.3 or higher.
  • Curl with SSL support.
  • The JSON PHP extension.

Installation

You can use Composer:

composer require adyen/php-api-library

Alternatively, you can download the release on GitHub.

Using the library

Set up a client and set the credentials to the Adyen platform.

If you don't know your X-API-KEY, you can obtain it from the Customer Area, as described in How to get the API key.

$client = new \Adyen\Client();
$client->setApplicationName("Adyen PHP API Library Example");
$client->setXApiKey("YOUR X-API-KEY");
$client->setEnvironment(\Adyen\Environment::TEST);

Specify whether you are using Adyen's test or live platform via setEnvironment().

$client->setEnvironment(\Adyen\Environment::TEST); //Test environment
$client->setEnvironment(\Adyen\Environment::LIVE); //Live environment

Java

Requirements

  • Java 7 or higher.

Installation

You can use Maven, adding this dependency to your project's POM.

<dependency>
  <groupId>com.adyen</groupId>
  <artifactId>adyen-java-api-library</artifactId>
  <version>1.5.3</version>
</dependency>

Alternatively, you can download the release on GitHub.

Using the library

Set up a client and set the credentials to the Adyen platform.

If you don't know your X-API-KEY, you can obtain it from the Customer Area, as described in How to get the API key.

Config config = new Config();
config.setApiKey("Your X-API-KEY"));
config.setApplicationName("Adyen Java API Library");
Client client = new Client(config);
client.setEnvironment(Environment.TEST);

Specify whether you are using Adyen's test or live platform via setEnvironment().

client.setEnvironment(Environment.TEST); //Test environment
client.setEnvironment(Environment.LIVE); //Live environment

Ruby

Requirements

  • Ruby 2.1 or higher.

Installation

You can use ruby gems:

gem install adyen-official

Alternatively, you can download the release on GitHub.

Run bundle install to install dependencies.

Using the library

Set up a client and set the credentials to the Adyen platform.

If you don't know your X-API-KEY, you can obtain it from the Customer Area, as described in How to get the API key.

require 'adyen'

adyen = Adyen::Client.new 
adyen.api_key = "YOUR X-API-KEY"
adyen.env = :test

Specify whether you are using Adyen's test or live platform via the env variable.

adyen.env = :test //Test environment
adyen.env = :live //Live environment