PHPackages                             paylike/php-api - 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. paylike/php-api

AbandonedLibrary

paylike/php-api
===============

PHP SDK to communicate with the Paylike HTTP API

2.0.0(3y ago)10320.6k↑66.9%12[1 PRs](https://github.com/paylike/php-api/pulls)4MITPHPPHP &gt;=5.6.0

Since Apr 11Pushed 2y ago4 watchersCompare

[ Source](https://github.com/paylike/php-api)[ Packagist](https://packagist.org/packages/paylike/php-api)[ RSS](/packages/paylike-php-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (10)Used By (4)

THIS SDK HAS BEEN DISCONTINUED
==============================

[](#this-sdk-has-been-discontinued)

Paylike client (PHP)
====================

[](#paylike-client-php)

You can sign up for a Paylike account at .

Getting an API key
------------------

[](#getting-an-api-key)

An API key can be obtained by creating a merchant and adding an app through Paylike [dashboard](https://app.paylike.io).

Requirements
------------

[](#requirements)

PHP 5.3.3 and later.

Install
-------

[](#install)

You can install the package via [Composer](http://getcomposer.org/). Run the following command:

```
composer require paylike/php-api
```

If you don't use Composer, you can download the [latest release](https://github.com/paylike/php-api/releases) and include the `init.php` file.

```
require_once('/path/to/php-api/init.php');
```

Dependencies
------------

[](#dependencies)

The bindings require the following extension in order to work properly:

- [`curl`](https://secure.php.net/manual/en/book.curl.php)

If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.
If you don't want to use curl, you can create your own client to extend from `HttpClientInterface` and send that as a parameter when instantiating the `Paylike` class.

Example
-------

[](#example)

```
$paylike = new \Paylike\Paylike($private_api_key);

// fetch a card
$cards = $paylike->cards();
$card  = $cards->fetch($card_id);

// capture a transaction
$transactions = $paylike->transactions();
$transaction  = $transactions->capture($transaction_id, array(
    'amount'   => 100,
    'currency' => 'EUR'
));
```

Methods
-------

[](#methods)

```
$paylike = new \Paylike\Paylike($private_api_key);

$apps = $paylike->apps();
$apps->create($args);
$apps->fetch();

$merchants = $paylike->merchants();
$merchants->create($args);
$merchants->fetch($merchant_id);
$merchants->update($merchant_id, $args);
$all_merchants = $merchants->find($app_id,$args);
$some_merchants = $merchants->before($app_id,$before);
$some_merchants = $merchants->after($app_id,$before);
$all_lines = $merchants->lines()->find($merchant_id,$args);
$some_lines = $merchants->lines()->before($merchant_id,$before);
$some_lines = $merchants->lines()->after($merchant_id, $after);
$all_apps = $merchants->apps()->find($merchant_id,$args);
$merchants->lines()->add($merchant_id,$app_id);
$merchants->lines()->revoke($merchant_id,$app_id);

$cards = $paylike->cards();
$cards->create($merchant_id, $args);
$cards->fetch($card_id);

$transactions = $paylike->transactions();
$transactions->create($merchant_id, $args);
$transactions->fetch($transaction_id);
$transactions->capture($transaction_id, $args);
$transactions->void($transaction_id, $args);
$transactions->refund($transaction_id, $args);
$all_transactions = $transactions->find($merchant_id,$args);
$some_transactions = $transactions->before($merchant_id,$before);
$some_transactions = $transactions->after($merchant_id,$before);

// explicit args
$limit = 10;
$after = '5b8e839d7cc76f04ecd3f733';
$before = '5b98deef882cf804f6108700';
$api_transactions = $transactions->find($merchant_id, array(
    'limit' => $limit,
    'after' => $after,
    'before' => $before,
    'filter' => array(
    	'successful' => true
    )
));
```

Pagination
----------

[](#pagination)

The methods that return multiple merchants/transactions (find,after,before) use cursors, so you don't need to worry about pagination, you can access any index, or iterate all the items, this is handled in the background.

Error handling
--------------

[](#error-handling)

The api wrapper will throw errors when things do not fly. All errors inherit from `ApiException`. A very verbose example of catching all types of errors:

```
$paylike = new \Paylike\Paylike($private_api_key);
try {
    $transactions = $paylike->transactions();
    $transactions->capture($transaction_id, array(
        'amount'   => 100,
        'currency' => 'EUR'
    ));
} catch (\Paylike\Exception\NotFound $e) {
    // The transaction was not found
} catch (\Paylike\Exception\InvalidRequest $e) {
    // Bad (invalid) request - see $e->getJsonBody() for the error
} catch (\Paylike\Exception\Forbidden $e) {
    // You are correctly authenticated but do not have access.
} catch (\Paylike\Exception\Unauthorized $e) {
    // You need to provide credentials (an app's API key)
} catch (\Paylike\Exception\Conflict $e) {
    // Everything you submitted was fine at the time of validation, but something changed in the meantime and came into conflict with this (e.g. double-capture).
} catch (\Paylike\Exception\ApiConnection $e) {
    // Network error on connecting via cURL
} catch (\Paylike\Exception\ApiException $e) {
    // Unknown api error
}
```

In most cases catching `NotFound` and `InvalidRequest` as client errors and logging `ApiException` would suffice.

Development
-----------

[](#development)

Install dependencies:

```
composer install
```

Tests
-----

[](#tests)

Install dependencies as mentioned above (which will resolve [PHPUnit](http://packagist.org/packages/phpunit/phpunit)), then you can run the test suite:

```
./vendor/bin/phpunit
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community24

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 87.5% of commits — single point of failure

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 ~221 days

Recently: every ~383 days

Total

9

Last Release

1188d ago

Major Versions

1.0.8 → 2.0.02023-02-15

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

1.0.7PHP &gt;=5.3.3

2.0.0PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/9b0c733b5f616cded3032adbbd115faecdf892e407f4ccdee59d00bb84360f78?d=identicon)[paylike](/maintainers/paylike)

---

Top Contributors

[![ionutcalara](https://avatars.githubusercontent.com/u/5338839?v=4)](https://github.com/ionutcalara "ionutcalara (42 commits)")[![tjconcept](https://avatars.githubusercontent.com/u/801895?v=4)](https://github.com/tjconcept "tjconcept (3 commits)")[![cristiancalara](https://avatars.githubusercontent.com/u/6623183?v=4)](https://github.com/cristiancalara "cristiancalara (1 commits)")[![JorgenVatle](https://avatars.githubusercontent.com/u/4034561?v=4)](https://github.com/JorgenVatle "JorgenVatle (1 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/paylike-php-api/health.svg)

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

PHPackages © 2026

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