PHPackages                             tmoldri/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. [API Development](/categories/api)
4. /
5. tmoldri/gateway-php-sdk

ActiveLibrary[API Development](/categories/api)

tmoldri/gateway-php-sdk
=======================

Client for Dokobit Gateway API

v1.2.1(4y ago)015MITPHPPHP &gt;=7.2.0

Since Mar 8Pushed 4y agoCompare

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

READMEChangelog (3)Dependencies (6)Versions (11)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

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 82% 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 ~149 days

Recently: every ~257 days

Total

9

Last Release

1791d ago

Major Versions

v0.9 → v1.02018-07-25

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

v0.8PHP &gt;=7.0.0

v1.2.0PHP &gt;=7.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/42786c64b5e3b242594e1f69b2d17f7e8d5f2cc310ac2000d5ae8c8fc18d119a?d=identicon)[taunoM](/maintainers/taunoM)

---

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)")[![tmoldri](https://avatars.githubusercontent.com/u/35997896?v=4)](https://github.com/tmoldri "tmoldri (3 commits)")[![prialgauskaslt](https://avatars.githubusercontent.com/u/7746850?v=4)](https://github.com/prialgauskaslt "prialgauskaslt (2 commits)")[![koliaq](https://avatars.githubusercontent.com/u/5172429?v=4)](https://github.com/koliaq "koliaq (1 commits)")[![vbdoko](https://avatars.githubusercontent.com/u/58209735?v=4)](https://github.com/vbdoko "vbdoko (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

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

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

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[silverstripe/framework

The SilverStripe framework

7213.5M2.5k](/packages/silverstripe-framework)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

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

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[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)
