PHP
Requirements
- PHP 7.3 or later.
- 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:
Set up the client as a singleton resource; you'll use it for the API calls that you make to Adyen:
$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
To make your first payment, follow the instructions on our API integration guide.
Clone our example integration
For a closer look at how our PHP library works, clone our Laravel example integration. This includes commented code, highlighting key features and concepts, and examples of API calls that can be made using the library.
Java
Requirements
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</version>
</dependency>
You can find the latest version 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:
Set up the client as a singleton resource; you'll use it for the API calls that you make to Adyen:
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
To make your first payment, follow the instructions on our API integration guide.
Clone our example integration
For a closer look at how our Java library works, clone our Java/SparkJava example integration. This includes commented code, highlighting key features and concepts, and examples of API calls that can be made using the library.
Node
Requirements
Installation
You can use npm:
npm install @adyen/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.
For Test:
Set up the client as a singleton resource; you'll use it for the API calls that you make to Adyen:
const client = new Client({apiKey: [YOUR_API_KEY], environment: 'TEST'});
For Live:
When you want to process on the live environment, include your live URL prefix:
const client = new Client({apiKey: [YOUR_API_KEY], environment: 'LIVE', liveEndpointUrlPrefix: 'YOUR_LIVE_ENDPOINT_PREFIX'});
To make your first payment, follow the instructions on our API integration guide.
Clone our example integration
For a closer look at how our Node library works, clone our example Node/Express or React/Express integrations. These include commented code, highlighting key features and concepts, and examples of API calls that can be made using the library.
Ruby
Requirements
Installation
You can use ruby gems:
gem install adyen-ruby-api-library
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:
Set up the client as a singleton resource; you'll use it for the API calls that you make to Adyen:
require 'adyen-ruby-api-library'
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"
To make your first payment, follow the instructions on our API integration guide.
Clone our example integration
For a closer look at how our Ruby library works, clone our Ruby on Rails example integration. This includes commented code, highlighting key features and concepts, and examples of API calls that can be made using the library.
C#
Requirements
Installation
You can use NuGet:
PM> Install-Package Adyen
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:
Set up the client as a singleton resource; you'll use it for the API calls that you make to Adyen:
var client = new Client ("YOUR-X-API-KEY", Adyen.Model.Enum.Environment.Test); // Test Environment
For Live:
When you want to process on the live environment, include your live URL prefix:
var client = new Client ("YOUR X-API-KEY", Adyen.Model.Enum.Environment.Live, "Your live URL prefix"); //Live environment
To make your first payment, follow the instructions on our API integration guide.
Python
Requirements
- Python 2.7 or 3.6
- Packages: Requests or PycURL (optional)
Installation
You can use pip:
pip install Adyen
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:
Set up the client as a singleton resource; you'll use it for the API calls that you make to Adyen:
ady = Adyen.Adyen()
client = ady.client
client.xapikey = "YOUR X-API-KEY"
client.platform = "test"
For Live:
When you want to process on the live environment, include your live URL prefix:
client.xapikey = "YOUR X-API-KEY"
client.platform = "live"
client.live_endpoint_prefix= "Your live URL prefix"
To make your first payment, follow the instructions on our API integration guide.
Clone our example integration
For a closer look at how our Python library works, clone our Python/Flask example integration. This includes commented code, highlighting key features and concepts, and examples of API calls that can be made using the library.
Go
Requirements
Installation
You can use Go modules:
go get github.com/adyen/adyen-go-api-library/v2
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:
Set up the client as a singleton resource; you'll use it for the API calls that you make to Adyen:
import (
"github.com/adyen/adyen-go-api-library/v2/src/adyen"
"github.com/adyen/adyen-go-api-library/v2/src/common"
)
client := adyen.NewClient(&common.Config{
ApiKey: "YOUR-API-KEY",
Environment: common.TestEnv,
})
For Live:
When you want to process on the live environment, include your live URL prefix:
import (
"github.com/adyen/adyen-go-api-library/v2/src/adyen"
"github.com/adyen/adyen-go-api-library/v2/src/common"
)
client := adyen.NewClient(&common.Config{
ApiKey: "your api key",
Environment: common.LiveEnv,
LiveEndpointURLPrefix: "YOUR_LIVE_ENDPOINT_PREFIX",
})
To make your first payment, follow the instructions on our API integration guide.