PHPackages                             merry-goblin/php-api-library - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. merry-goblin/php-api-library

ActiveLibrary[API Development](/categories/api)

merry-goblin/php-api-library
============================

A PHP client library for accessing Adyen APIs

11.0.0(4y ago)032MITPHPPHP &gt;=7.3

Since Feb 9Pushed 11mo agoCompare

[ Source](https://github.com/merry-goblin/adyen-php-api-library)[ Packagist](https://packagist.org/packages/merry-goblin/php-api-library)[ Docs](https://github.com/Adyen/adyen-php-api-library)[ RSS](/packages/merry-goblin-php-api-library/feed)WikiDiscussions develop Synced 1w ago

READMEChangelog (1)Dependencies (6)Versions (52)Used By (0)

Adyen APIs Library for PHP
==========================

[](#adyen-apis-library-for-php)

This is the officially supported PHP library for using Adyen's APIs.

Integration
-----------

[](#integration)

The library supports all APIs under the following services:

- [Checkout API](https://docs.adyen.com/api-explorer/#/CheckoutService/v68/overview): Our latest integration for accepting online payments. Current supported version: **v68**
- [Payments API](https://docs.adyen.com/api-explorer/#/Payment/v51/overview): Our classic integration for online payments. Current supported version: **v51**
- [Recurring API](https://docs.adyen.com/api-explorer/#/Recurring/v49/overview): Endpoints for managing saved payment details. Current supported version: **v49**
- [Payouts API](https://docs.adyen.com/api-explorer/#/Payout/v51/overview): Endpoints for sending funds to your customers. Current supported version: **v51**
- [Platforms APIs](https://docs.adyen.com/platforms/api): Set of APIs when using Adyen for Platforms.
    - [Account API](https://docs.adyen.com/api-explorer/#/Account/v5/overview) Current supported version: **v5**
    - [Fund API](https://docs.adyen.com/api-explorer/#/Fund/v5/overview) Current supported version: **v5**
    - [Notification Configuration API](https://docs.adyen.com/api-explorer/#/NotificationConfigurationService/v5/overview) Current supported version: **v5**
- [Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/terminal-api-reference): Our point-of-sale integration.
- [Referrals API](https://docs.adyen.com/risk-management/automate-submitting-referrals/referrals-api-reference): Endpoints to [automate submitting referrals](https://docs.adyen.com/risk-management/automate-submitting-referrals) for Adyen risk rules.
- [HOP API](https://docs.adyen.com/api-explorer/#/Hop/v5/overview): Adyen for Platforms Hosted Onboarding API. Current supported version: **v5**

For more information, refer to our [documentation](https://docs.adyen.com/) or the [API Explorer](https://docs.adyen.com/api-explorer/).

Prerequisites
-------------

[](#prerequisites)

- [Adyen test account](https://docs.adyen.com/get-started-with-adyen)
- [API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). For testing, your API credential needs to have the [API PCI Payments role](https://docs.adyen.com/development-resources/api-credentials#roles).
- PHP 7.3 or later
- cURL with SSL support.
- The JSON PHP extension.
- See [composer require list](https://github.com/Adyen/adyen-php-api-library/blob/develop/composer.json#L10) for the complete list of dependencies

### Legacy version support

[](#legacy-version-support)

If using PHP versions 7.2 or lower, download our library version [6.3.0](https://github.com/Adyen/adyen-php-api-library/releases/tag/6.3.0).

Installation
------------

[](#installation)

You can use [Composer](https://getcomposer.org/). Follow the [installation instructions](https://getcomposer.org/doc/00-intro.md) 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](https://github.com/Adyen/adyen-php-api-library/releases).

Using the library
-----------------

[](#using-the-library)

### General use with API key

[](#general-use-with-api-key)

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 API KEY");
$client->setEnvironment(\Adyen\Environment::TEST);
$client->setTimeout(30);

$service = new \Adyen\Service\Checkout($client);

$json = '{
      "card": {
        "encryptedCardNumber" => "test_4111111111111111",
        "encryptedExpiryMonth" => "test_03",
        "encryptedExpiryYear" => "test_2030",
        "encryptedSecurityCode" => "test_737"
        "holderName": "John Smith"
      },
      "amount": {
        "value": 1500,
        "currency": "EUR"
      },
      "reference": "payment-test",
      "merchantAccount": "YOUR MERCHANT ACCOUNT"
}';

$params = json_decode($json, true);

$result = $service->payments($params);
```

### General use with API key for live environment

[](#general-use-with-api-key-for-live-environment)

```
$client = new \Adyen\Client();
$client->setXApiKey("YOUR API KEY");
$client->setEnvironment(\Adyen\Environment::LIVE, 'Your live URL prefix');
$client->setTimeout(30);

...
```

### General use with basic auth

[](#general-use-with-basic-auth)

```
$client = new \Adyen\Client();
$client->setUsername("YOUR USERNAME");
$client->setPassword("YOUR PASSWORD");
$client->setEnvironment(\Adyen\Environment::TEST);
$client->setTimeout(30);

$service = new \Adyen\Service\Payment($client);

$json = '{
      "card": {
        "number": "4111111111111111",
        "expiryMonth": "10",
        "expiryYear": "2020",
        "cvc": "737",
        "holderName": "John Smith"
      },
      "amount": {
        "value": 1500,
        "currency": "EUR"
      },
      "reference": "payment-test",
      "merchantAccount": "YOUR MERCHANT ACCOUNT"
}';

$params = json_decode($json, true);

$result = $service->authorise($params);
```

### Example integration

[](#example-integration)

For a closer look at how our PHP library works, clone our [Laravel example integration](https://github.com/adyen-examples/adyen-php-online-payments). This includes commented code, highlighting key features and concepts, and examples of API calls that can be made using the library.

### Running the tests

[](#running-the-tests)

For the test cases you need the PCI permission enabled on you account. There are no test cases for CSE because credit card data is encrypted through our javascript library. By default the test will then be skipped. If you have these permissions fill in your account details in the config/test.ini file to let the test work. To make the automatic testing cases work for your account change the credentials in the config/test.ini file.

Contributing
------------

[](#contributing)

We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements. Have a look at our [contributing guidelines](https://github.com/Adyen/adyen-php-api-library/blob/develop/CONTRIBUTING.md) to find out how to raise a pull request.

Support
-------

[](#support)

If you have a feature request, or spotted a bug or a technical problem, [create an issue here](https://github.com/Adyen/adyen-php-api-library/issues/new/choose).

For other questions, [contact our Support Team](https://www.adyen.help/hc/en-us/requests/new?ticket_form_id=360000705420).

Licence
-------

[](#licence)

This repository is available under the [MIT license](https://github.com/Adyen/adyen-php-api-library/blob/master/LICENSE).

See also
--------

[](#see-also)

- [Example integration](https://github.com/adyen-examples/adyen-php-online-payments)
- [Adyen docs](https://docs.adyen.com/)
- [API Explorer](https://docs.adyen.com/api-explorer/)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~56 days

Recently: every ~66 days

Total

38

Last Release

1674d ago

Major Versions

6.3.0 → 7.0.02020-06-30

7.1.0 → 8.0.02020-10-09

8.1.0 → 9.0.02021-01-26

9.0.0 → 10.0.02021-03-23

8.1.1 → 11.0.02021-10-18

PHP version history (3 changes)1.0.0PHP &gt;=5.3

7.0.0PHP &gt;=5.6

11.0.0PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/e8e204b0c3d356f04a20ee83277873248de27d88e6eec76259b81bcd7f04d96c?d=identicon)[merry-goblin](/maintainers/merry-goblin)

---

Top Contributors

[![rikterbeek](https://avatars.githubusercontent.com/u/5948499?v=4)](https://github.com/rikterbeek "rikterbeek (108 commits)")[![Aleffio](https://avatars.githubusercontent.com/u/1391660?v=4)](https://github.com/Aleffio "Aleffio (59 commits)")[![cyattilakiss](https://avatars.githubusercontent.com/u/42297201?v=4)](https://github.com/cyattilakiss "cyattilakiss (48 commits)")[![renovate-bot](https://avatars.githubusercontent.com/u/25180681?v=4)](https://github.com/renovate-bot "renovate-bot (31 commits)")[![peterojo](https://avatars.githubusercontent.com/u/5240725?v=4)](https://github.com/peterojo "peterojo (25 commits)")[![msilvagarcia](https://avatars.githubusercontent.com/u/338820?v=4)](https://github.com/msilvagarcia "msilvagarcia (23 commits)")[![lancergr](https://avatars.githubusercontent.com/u/1558756?v=4)](https://github.com/lancergr "lancergr (14 commits)")[![AlexandrosMor](https://avatars.githubusercontent.com/u/16090523?v=4)](https://github.com/AlexandrosMor "AlexandrosMor (14 commits)")[![merry-goblin](https://avatars.githubusercontent.com/u/5331158?v=4)](https://github.com/merry-goblin "merry-goblin (12 commits)")[![acampos1916](https://avatars.githubusercontent.com/u/15349721?v=4)](https://github.com/acampos1916 "acampos1916 (11 commits)")[![rvitaliy](https://avatars.githubusercontent.com/u/1823711?v=4)](https://github.com/rvitaliy "rvitaliy (5 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (5 commits)")[![jocel1](https://avatars.githubusercontent.com/u/1429072?v=4)](https://github.com/jocel1 "jocel1 (4 commits)")[![cangelis](https://avatars.githubusercontent.com/u/1162691?v=4)](https://github.com/cangelis "cangelis (3 commits)")[![georgegg](https://avatars.githubusercontent.com/u/872983?v=4)](https://github.com/georgegg "georgegg (3 commits)")[![aprasker](https://avatars.githubusercontent.com/u/26895058?v=4)](https://github.com/aprasker "aprasker (3 commits)")[![KadoBOT](https://avatars.githubusercontent.com/u/11719845?v=4)](https://github.com/KadoBOT "KadoBOT (2 commits)")[![fabricioblz](https://avatars.githubusercontent.com/u/17836184?v=4)](https://github.com/fabricioblz "fabricioblz (2 commits)")[![nursultanturdaliev](https://avatars.githubusercontent.com/u/1384060?v=4)](https://github.com/nursultanturdaliev "nursultanturdaliev (1 commits)")[![patrickmyh](https://avatars.githubusercontent.com/u/8437284?v=4)](https://github.com/patrickmyh "patrickmyh (1 commits)")

---

Tags

adyen

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/merry-goblin-php-api-library/health.svg)

```
[![Health](https://phpackages.com/badges/merry-goblin-php-api-library/health.svg)](https://phpackages.com/packages/merry-goblin-php-api-library)
```

###  Alternatives

[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

67410.3M25](/packages/googleads-googleads-php-lib)[googleads/google-ads-php

Google Ads API client for PHP

3497.6M9](/packages/googleads-google-ads-php)[team-reflex/discord-php

An unofficial API to interact with the voice and text service Discord.

1.1k379.4k24](/packages/team-reflex-discord-php)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
