PHPackages                             getkevin/kevin-php - 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. getkevin/kevin-php

ActiveLibrary[API Development](/categories/api)

getkevin/kevin-php
==================

PHP client for kevin. platform.

0.18.0(3y ago)5565.4k↓11.9%21MITPHPPHP &gt;=5.6

Since Jul 24Pushed 3y ago2 watchersCompare

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

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

kevin. PHP Client
=================

[](#kevin-php-client)

> PHP client implementing kevin. API.

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

[](#prerequisites)

- PHP 5.6 or later

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

[](#installation)

### Composer

[](#composer)

1. To install latest kevin. PHP Client repository using composer:

```
composer require getkevin/kevin-php
```

2. Using Composer autoloader, include kevin. PHP Client:

```
require('vendor/autoload.php');
```

> Detailed information about available versions can be found at packagist repository:
>
>

Usage Examples
--------------

[](#usage-examples)

> Parameter names and response data match those defined in API documentation.

> Detailed API documentation can be found [here](https://docs.kevin.eu/public/platform).

### Initialization

[](#initialization)

```
use Kevin\Client;

$clientId = 'my-client-id';
$clientSecret = 'my-client-secret';
$options = ['error' => 'array', 'version' => '0.3', 'lang' => 'en'];

$kevinClient = new Client($clientId, $clientSecret, $options);
```

> `$clientId` - Your client id. Your can get it in kevin. platform console.

> `$clientSecret` - Your client secret. Your can get it in kevin. platform console.

> `$options` - Optional options array.
>
> - `error` - Defines return type of error data. Possible values are: `array` - returns an array on error, `exception` - throws an exception on error, default value is `exception`.
> - `version` - Selects API versions to use. Default value is `0.3`. Possible values are `0.1`, `0.2` or `0.3`.
> - `lang` - a two-letter lowercase language code defined in ISO 639-1 standart. Sets the language of the frame page.

### 1. Authentication

[](#1-authentication)

### 1.1 Get supported countries

[](#11-get-supported-countries)

```
$response = $kevinClient->auth()->getCountries();
```

### 1.2 Get supported banks

[](#12-get-supported-banks)

```
$attr = ['countryCode' => 'LT'];
$response = $kevinClient->auth()->getBanks($attr);
```

### 1.3 Get supported bank

[](#13-get-supported-bank)

```
$bankId = 'SEB_LT_SAND';
$response = $kevinClient->auth()->getBank($bankId);
```

### 1.4 Get project settings

[](#14-get-project-settings)

```
$response = $kevinClient->auth()->getProjectSettings();
```

### 1.5 Start authentication

[](#15-start-authentication)

```
$attr = [
    'redirectPreferred' => 'false',
    'scopes' => 'payments,accounts_basic',
    'Request-Id' => 'your-guid',
    'Redirect-URL' => 'https://redirect.kevin.eu/authorization.html'
];
$response = $kevinClient->auth()->authenticate($attr);
```

### 1.6 Receive token

[](#16-receive-token)

```
$attr = ['code' => 'your-auth-code'];
// ...or $attr = 'your-auth-code';
$response = $kevinClient->auth()->receiveToken($attr);
```

### 1.7 Refresh token

[](#17-refresh-token)

```
$attr = ['refreshToken' => 'your-refresh-token'];
// ...or $attr = 'your-refresh-token';
$response = $kevinClient->auth()->refreshToken($attr);
```

### 1.8 Receive token content

[](#18-receive-token-content)

```
$attr = ['Authorization' => 'your-bearer-token'];
// ...or $attr = 'your-bearer-token';
// ...or $attr = 'Bearer your-bearer-token';
$response = $kevinClient->auth()->receiveTokenContent($attr);
```

### 2. Payment

[](#2-payment)

### 2.1 Initiate bank payment

[](#21-initiate-bank-payment)

```
$attr = [
    'Redirect-URL' => 'https://redirect.kevin.eu/payment.html',
    'description' => 'Test',
    'currencyCode' => 'EUR',
    'amount' => '0.01',
    'bankPaymentMethod' => [
        'endToEndId' => '1',
        'creditorName' => 'John Smith',
        'creditorAccount' => [
            'iban' => 'LT0000000000000000'
        ],
    ],
];
$response = $kevinClient->payment()->initPayment($attr);
```

### 2.2 Initiate card payment

[](#22-initiate-card-payment)

```
$attr = [
    'Redirect-URL' => 'https://redirect.kevin.eu/payment.html',
    'description' => 'Test',
    'currencyCode' => 'EUR',
    'amount' => '0.01',
    'bankPaymentMethod' => [
        'endToEndId' => '1',
        'creditorName' => 'John Smith',
        'creditorAccount' => [
            'iban' => 'LT0000000000000000',
        ],
    ],
    'cardPaymentMethod' => [],
    'paymentMethodPreferred' => 'card',
];
$response = $kevinClient->payment()->initPayment($attr);
```

### 2.3 Initiate hybrid payment

[](#23-initiate-hybrid-payment)

```
$attr = [
    'Redirect-URL' => 'https://redirect.kevin.eu/payment.html',
    'description' => 'Test',
    'currencyCode' => 'EUR',
    'amount' => '0.01',
    'bankPaymentMethod' => [
        'endToEndId' => '1',
        'creditorName' => 'John Smith',
        'creditorAccount' => [
            'iban' => 'LT0000000000000000'
        ],
    ],
    'cardPaymentMethod' => [],
];
$response = $kevinClient->payment()->initPayment($attr);
```

### 2.4 Get payment

[](#24-get-payment)

```
$paymentId = 'your-payment-id';
$response = $kevinClient->payment()->getPayment($paymentId);
```

### 2.5 Get payment status

[](#25-get-payment-status)

```
$paymentId = 'your-payment-id';
$response = $kevinClient->payment()->getPaymentStatus($paymentId);
```

### 2.6 Initiate payment refund

[](#26-initiate-payment-refund)

```
$paymentId = 'your-payment-id';
$attr = [
    'amount' => '1.00',
    'Webhook-URL' => 'https://yourapp.com/notify'
];
$response = $kevinClient->payment()->initiatePaymentRefund($paymentId, $attr);
```

### 2.7 Get payment refunds

[](#27-get-payment-refunds)

```
$paymentId = 'your-payment-id';
$response = $kevinClient->payment()->getPaymentRefunds($paymentId);
```

### 3. Account

[](#3-account)

### 3.1 Get accounts

[](#31-get-accounts)

```
$accessToken = 'your-bearer-token';
$attr = [
    'Authorization' => $accessToken,
    'PSU-IP-Address' => 'your-ip-address',
    'PSU-User-Agent' => 'your-user-agent',
    'PSU-IP-Port' => 'your-ip-port',
    'PSU-Http-Method' => 'GET',
    'PSU-Device-ID' => 'your-device-id'
];
$response = $kevinClient->account()->getAccountList($attr);
```

### 3.2 Get account details

[](#32-get-account-details)

```
$accountId = 'your-account-id';
$accessToken = 'your-bearer-token';
$attr = [
    'Authorization' => $accessToken,
    'PSU-IP-Address' => 'your-ip-address',
    'PSU-User-Agent' => 'your-user-agent',
    'PSU-IP-Port' => 'your-ip-port',
    'PSU-Http-Method' => 'GET',
    'PSU-Device-ID' => 'your-device-id'
];
$response = $kevinClient->account()->getAccountDetails($accountId, $attr);
```

### 3.3 Get account transactions

[](#33-get-account-transactions)

```
$accountId = 'your-account-id';
$accessToken = 'your-bearer-token';
$attr = [
    'Authorization' => $accessToken,
    'PSU-IP-Address' => 'your-ip-address',
    'PSU-User-Agent' => 'your-user-agent',
    'PSU-IP-Port' => 'your-ip-port',
    'PSU-Http-Method' => 'GET',
    'PSU-Device-ID' => 'your-device-id',
    'dateFrom' => '2021-09-01',
    'dateTo' => '2021-09-15'
];
$response = $kevinClient->account()->getAccountTransactions($accountId, $attr);
```

### 3.4 Get account balance

[](#34-get-account-balance)

```
$accountId = 'your-account-id';
$accessToken = 'your-bearer-token';
$attr = [
    'Authorization' => $accessToken,
    'PSU-IP-Address' => 'your-ip-address',
    'PSU-User-Agent' => 'your-user-agent',
    'PSU-IP-Port' => 'your-ip-port',
    'PSU-Http-Method' => 'GET',
    'PSU-Device-ID' => 'your-device-id'
];
$response = $kevinClient->account()->getAccountBalance($accountId, $attr);
```

### 4. Security

[](#4-security)

### 4.1 Verify signature

[](#41-verify-signature)

❗ *We recommend ignoring the webhook if the signature is older than 5 minutes.*

```
use Kevin\SecurityManager;

$endpointSecret = 'your-endpoint-secret';
$webhookUrl = 'your-webhook-url';

// Timestamp is provided in milliseconds
$timestampTimeout = 300000;

$requestBody = file_get_contents("php://input");
$headers = getallheaders();

$isValid = SecurityManager::verifySignature($endpointSecret, $requestBody, $headers, $webhookUrl, $timestampTimeout);
```

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

[](#contributing)

Before making any code changes, make sure to run `composer install` to install development requirements.

We are using PHP CS Fixer GitHub action to conduct code style checks for each commit and pull request. Make sure to run `composer fix-style` before committing changes to make sure your code matches our style standards. Pull requests with failed style checks will not be approved.

*WARNING*: we use risky rules so make sure to check for breaking style fixes.

Style errors and violated rules log can be viewed by running `composer check-style` command.

Support
-------

[](#support)

Email:

License
-------

[](#license)

- **[MIT license](http://opensource.org/licenses/mit-license.php)**
- Copyright© 2020 [kevin.](https://www.kevin.eu/)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor2

2 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 ~38 days

Recently: every ~94 days

Total

27

Last Release

1125d ago

PHP version history (3 changes)0.5.0PHP &gt;=5.6 || &gt;=7.0

0.6.0PHP &gt;=7.0

0.9.0PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/ebb70a08eb2f764955134e04a1e22a0b2356ac80444cbfb9a202416315339a88?d=identicon)[kevineu](/maintainers/kevineu)

---

Top Contributors

[![mindaugas236](https://avatars.githubusercontent.com/u/68636803?v=4)](https://github.com/mindaugas236 "mindaugas236 (10 commits)")[![vytautasgimbutas](https://avatars.githubusercontent.com/u/1172971?v=4)](https://github.com/vytautasgimbutas "vytautasgimbutas (10 commits)")[![saltanovas](https://avatars.githubusercontent.com/u/65735690?v=4)](https://github.com/saltanovas "saltanovas (7 commits)")[![alext-neurony](https://avatars.githubusercontent.com/u/170939568?v=4)](https://github.com/alext-neurony "alext-neurony (2 commits)")[![KubaJM](https://avatars.githubusercontent.com/u/107397557?v=4)](https://github.com/KubaJM "KubaJM (2 commits)")[![Daaarkling](https://avatars.githubusercontent.com/u/10207494?v=4)](https://github.com/Daaarkling "Daaarkling (1 commits)")

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/getkevin-kevin-php/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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