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. Follow the installation instructions if you do not already have composer installed.

composer require adyen/php-api-library

In your PHP script, make sure you include the autoloader:

require __DIR__ . '/vendor/autoload.php';


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.

For Test:

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

For Live:

When you want to process on the live environment, include your live URL prefix:

$client->setEnvironment(\Adyen\Environment::LIVE, "Your live URL prefix"); //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>LATEST</version>
</dependency>

You can find the LATEST version on GitHub, 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.

For Test:

Client client = new Client("Your X-API-KEY", Environment.TEST); //Test environment

For Live:

When you want to process on the live environment, include your live URL prefix:

Client client = new Client("Your X-API-KEY", Environment.LIVE, "Your live URL prefix"); //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.

For Test:

require 'adyen'

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

For Live:

When you want to process on the live environment, include your live URL prefix:

adyen.env = :live # Live environment
adyen.live_url_prefix = "Your live URL prefix"