PHPackages                             dokobit/gateway-php-sdk - 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. dokobit/gateway-php-sdk

ActiveLibrary

dokobit/gateway-php-sdk
=======================

Client for Dokobit Gateway API

1.3.1(1y ago)222.5k↓22.1%9[1 issues](https://github.com/dokobit/gateway-sdk-php/issues)MITPHPPHP ^7.2.5|^8.0

Since Mar 8Pushed 1y ago4 watchersCompare

[ Source](https://github.com/dokobit/gateway-sdk-php)[ Packagist](https://packagist.org/packages/dokobit/gateway-php-sdk)[ Docs](https://www.dokobit.com)[ RSS](/packages/dokobit-gateway-php-sdk/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (9)Dependencies (5)Versions (12)Used By (0)

Dokobit Gateway PHP Client
==========================

[](#dokobit-gateway-php-client)

[![Build Status](https://camo.githubusercontent.com/56318fbd2c75dc272d42a38f73e710ec4585fcc5c46ef4e1d020d185ce95bbfa/68747470733a2f2f7472617669732d63692e6f72672f646f6b6f6269742f676174657761792d73646b2d7068702e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/dokobit/gateway-sdk-php)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a18670ac52fd81d741baf603babeee319b1f048a8fea65dbf75ecbc70de9a321/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f646f6b6f6269742f676174657761792d73646b2d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d646576656c6f70)](https://scrutinizer-ci.com/g/dokobit/gateway-sdk-php/?branch=develop)[![Code Coverage](https://camo.githubusercontent.com/7df8a3c5905b70cea5f89dcfc4c265b468b73586659ee989c6ed0fdd6efb318a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f646f6b6f6269742f676174657761792d73646b2d7068702f6261646765732f636f7665726167652e706e673f623d646576656c6f70)](https://scrutinizer-ci.com/g/dokobit/gateway-sdk-php/?branch=develop)[![Build Status](https://camo.githubusercontent.com/af1f702e6771ad8ca9943af2f613bf98850acbd7445c98f7d1bf831bbc99d8d7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f646f6b6f6269742f676174657761792d73646b2d7068702f6261646765732f6275696c642e706e673f623d646576656c6f70)](https://scrutinizer-ci.com/g/dokobit/gateway-sdk-php/build-status/master)

This library makes it easier to integrate [Dokobit Gateway API](https://www.dokobit.com/solutions/gateway-api) in PHP applications by wrapping all of the Gateway API calls and responses in PHP objects.

How to start?
-------------

[](#how-to-start)

1. Instantiate a client object:

    ```
    use Dokobit\Gateway\Client;

    //
    $client = Client::create([
        'apiKey' => 'xxxxxx',
        'sandbox' => true,
    ]);
    ```

    If you want to log requests, just pass a PSR-3 `LoggerInterface` compatible logger (such as a [Monolog](https://github.com/Seldaek/monolog) instance) as the second parameter to the `create()` method, like this:

    ```
    use Dokobit\Gateway\Client;
    use Monolog\Handler\StreamHandler;
    use Monolog\Logger;

    //
    $log = new Logger('requests');
    $log->pushHandler(new StreamHandler(__DIR__ . '/path/to/info.log', Logger::INFO));

    $client = Client::create([
        'apiKey' => 'xxxxxx',
        'sandbox' => true,
    ], $log);
    ```
2. Use the client instantiated above to make the desired API calls. To do that, instantiate a respective request object and pass it to the `get()` method of the client. For example, to upload a file to Gateway:

    ```
    use Dokobit\Gateway\Query\File\Upload;

    //
    $request = new Upload('/path/to/your/document.pdf');
    $result = $client->get($request);
    echo $result->getStatus(); // Request status
    echo $result->getToken(); // Uploaded file token
    ```

    The client performs an HTTP request and returns a result object, which has getters for all response fields. Should the request fail for any reason, an exception will be thrown, which should help you debug the issue.

The request (query) and response (result) classes closely mirror the API calls, which are documented at .

To make downloading of signed files more convenient, the `Client` class also provides the `downloadFile()` method. To download a signed file, just call this method like this:

```
$client->downloadFile($signedFileUrl, $downloadedFilePath);
```

Note: this method will append your access token to the URL automatically, so you can pass it the URLs you receive from the Gateway's postbacks in their verbatim form, without any changes. The same method can also be used to download arbitrary files from other locations, if necessary. Should you want to do that, just pass `false` as the third argument to avoid appending the access token, like this:

```
$client->downloadFile($signedFileUrl, $downloadedFilePath, false);
```

For further code usage examples, please check integration tests under `tests/Integration`.

Debugging
---------

[](#debugging)

To dig more into occured error use following methods:

```
echo (string) $exception->getMessage()
echo (string) $exception->getPrevious()->getResponse()
var_dump( $exception->getResponseData() )

```

These methods are available on all exception classes except `UnexpectedError` and `QueryValidator`.

Develop
-------

[](#develop)

Whole testsuite including integrational tests

```
phpunit

```

Don't forget to define `SANDBOX_API_KEY` in your phpunit.xml.

Running unit tests only:

```
phpunit --testsuite=Unit

```

Running integrational tests only:

```
phpunit --testsuite=Integration

```

Running single testcase:

```
phpunit tests/Integration/CheckTest.php

```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 75.2% 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 ~286 days

Recently: every ~578 days

Total

10

Last Release

411d ago

Major Versions

v0.9 → v1.02018-07-25

PHP version history (4 changes)v0.7PHP &gt;=5.5.9

v0.8PHP &gt;=7.0.0

v1.2.0PHP &gt;=7.2.0

v1.3.0PHP ^7.2.5|^8.0

### Community

Maintainers

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

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

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

---

Top Contributors

[![rimas-kudelis](https://avatars.githubusercontent.com/u/2812673?v=4)](https://github.com/rimas-kudelis "rimas-kudelis (82 commits)")[![kuusas](https://avatars.githubusercontent.com/u/1662530?v=4)](https://github.com/kuusas "kuusas (11 commits)")[![vbdoko](https://avatars.githubusercontent.com/u/58209735?v=4)](https://github.com/vbdoko "vbdoko (5 commits)")[![koliaq](https://avatars.githubusercontent.com/u/5172429?v=4)](https://github.com/koliaq "koliaq (4 commits)")[![Marrikulus](https://avatars.githubusercontent.com/u/15344566?v=4)](https://github.com/Marrikulus "Marrikulus (2 commits)")[![elvinaskacerauskas](https://avatars.githubusercontent.com/u/79836878?v=4)](https://github.com/elvinaskacerauskas "elvinaskacerauskas (2 commits)")[![prialgauskaslt](https://avatars.githubusercontent.com/u/7746850?v=4)](https://github.com/prialgauskaslt "prialgauskaslt (2 commits)")[![irojus](https://avatars.githubusercontent.com/u/10632080?v=4)](https://github.com/irojus "irojus (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dokobit-gateway-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/dokobit-gateway-php-sdk/health.svg)](https://phpackages.com/packages/dokobit-gateway-php-sdk)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M650](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[silverstripe/framework

The SilverStripe framework

7213.5M2.5k](/packages/silverstripe-framework)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6939.5M342](/packages/drupal-core-recommended)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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