PHPackages                             webtoucher/omnipay-platbox - 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. [Payment Processing](/categories/payments)
4. /
5. webtoucher/omnipay-platbox

ActiveLibrary[Payment Processing](/categories/payments)

webtoucher/omnipay-platbox
==========================

PlatBox driver for the Omnipay payment processing library

1.0.0(8y ago)11.7kBSD-3-ClausePHPPHP &gt;=5.4.0

Since Jul 31Pushed 5y ago1 watchersCompare

[ Source](https://github.com/webtoucher/omnipay-platbox)[ Packagist](https://packagist.org/packages/webtoucher/omnipay-platbox)[ Docs](https://github.com/webtoucher/omnipay-platbox)[ RSS](/packages/webtoucher-omnipay-platbox/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

Omnipay: PlatBox
================

[](#omnipay-platbox)

[PlatBox](https://platbox.com) payment processing driver for the Omnipay PHP payment processing library.

[![Latest Stable Version](https://camo.githubusercontent.com/baac4debffce24251bc3dedab69b95f104bc53193c29620424f9aa0974af9f9a/68747470733a2f2f706f7365722e707567782e6f72672f776562746f75636865722f6f6d6e697061792d706c6174626f782f762f737461626c65)](https://packagist.org/packages/webtoucher/omnipay-platbox)[![Total Downloads](https://camo.githubusercontent.com/45e631735689d996459e1b78d2d18c435d592ad9022875c8b8181175bb1b80b9/68747470733a2f2f706f7365722e707567782e6f72672f776562746f75636865722f6f6d6e697061792d706c6174626f782f646f776e6c6f616473)](https://packagist.org/packages/webtoucher/omnipay-platbox)[![Daily Downloads](https://camo.githubusercontent.com/b76157b9937aa762d926b013aa7b8519ae6682c19711358d756149e358dd29eb/68747470733a2f2f706f7365722e707567782e6f72672f776562746f75636865722f6f6d6e697061792d706c6174626f782f642f6461696c79)](https://packagist.org/packages/webtoucher/omnipay-platbox)[![Latest Unstable Version](https://camo.githubusercontent.com/81efd21caa3fe4cd8bf2ffc2a5b37b7157a2d413910b7f5291c3113af623a4e6/68747470733a2f2f706f7365722e707567782e6f72672f776562746f75636865722f6f6d6e697061792d706c6174626f782f762f756e737461626c65)](https://packagist.org/packages/webtoucher/omnipay-platbox)[![License](https://camo.githubusercontent.com/1b4f5ef5511bd626ca2fbd1e756a2ec1f68c9f778d80ceb137eecbb886bd2970/68747470733a2f2f706f7365722e707567782e6f72672f776562746f75636865722f6f6d6e697061792d706c6174626f782f6c6963656e7365)](https://packagist.org/packages/webtoucher/omnipay-platbox)

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

[](#installation)

The preferred way to install this library is through [composer](http://getcomposer.org/download/).

Either run

```
$ php composer.phar require webtoucher/omnipay-platbox "*"

```

or add

```
"webtoucher/omnipay-platbox": "*"

```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

The following gateways are provided by this package:

- PlatBox API ()

```
    $gateway = \Omnipay\Omnipay::create('PlatBox');
    $gateway->setMerchantId('[MERCHANT_ID]');
    $gateway->setSecretKey('[SECRET_KEY]');
    $gateway->setProject('[PROJECT]');
    // $gateway->setTestMode(true);
```

The first step is preparing data and sending to PlatBox.

```
    $request = $gateway->purchase([
        'order_id' => $orderId,
        'amount' => $amount,
        'currency' => 'RUB',
        'account_id' => $userId,
        'phone_number' => $phone,
    ]);
    $response = $request->send();
    $result = $response->isSuccessful();
```

There is the callback request handler.

```
    try {
        $data = json_decode(file_get_contents('php://input'), true);
    } catch (\Exception $e) {
        $data = [];
    }
    $action = isset($data['action']) ? $data['action'] : null;
    switch ($action) {
        case 'check':
            $request = $gateway->check($data);
            handleCallback($request, $failCallback);
            break;
        case 'pay':
            $request = $gateway->completePurchase($data);
            handleCallback($request, $failCallback, $successCallback);
            break;
        case 'cancel':
            $request = $gateway->completePurchase($data);
            handleCallback($request, $failCallback, $cancelCallback);
            break;
        default:
            // wrong request handler
    }
```

There is the callback request 'check' handler.

```
    function handleCallback($request, $failCallback = null, $completeCallback = null) {
        try {
            $orderId = $request->getOrderId();
            $order = [...]; // find order model by order ID.
            if (!$order) {
                PlatBoxException::throwException(PlatBoxException::CODE_ORDER_NOT_FOUND_OR_BAD_DATA);
            }
            // Check order status
            if ($order->status = [...]) { // already paid
                PlatBoxException::throwException(PlatBoxException::CODE_PAYMENT_ALREADY_COMPLETED);
            }
            if ($order->status = [...]) { // already cancelled
                PlatBoxException::throwException(PlatBoxException::CODE_PAYMENT_ALREADY_CANCELED);
            }

            $request->setMerchantOrderId($order->id);
            $request->setMerchantAmount($order->amount);
            $request->setMerchantCurrency($order->currency);

            $responseData = $response->getData();
            $response->confirm();
            if (is_callable($successCallback)) {
                call_user_func($successCallback, $response);
            }
        } catch (PlatBoxException $e) {
            if (is_callable($failCallback)) {
                call_user_func($failCallback, $response);
            }
            $request->error($e->getMessage(), $e->getCode());
        } catch (\Exception $e) {
            if (is_callable($failCallback)) {
                call_user_func($failCallback, $response);
            }
            $request->error();
        }
    }
```

For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay)repository.

Support
-------

[](#support)

If you are having general issues with Omnipay, we suggest posting on [Stack Overflow](http://stackoverflow.com/). Be sure to add the [omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to.

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/webtoucher/omnipay-platbox/issues).

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

3207d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/500243?v=4)[Алексей Кузнецов](/maintainers/webtoucher)[@webtoucher](https://github.com/webtoucher)

---

Top Contributors

[![webtoucher](https://avatars.githubusercontent.com/u/500243?v=4)](https://github.com/webtoucher "webtoucher (3 commits)")

---

Tags

mobilepaymentpaymentsgatewaypaymerchantomnipayplatbox

### Embed Badge

![Health badge](/badges/webtoucher-omnipay-platbox/health.svg)

```
[![Health](https://phpackages.com/badges/webtoucher-omnipay-platbox/health.svg)](https://phpackages.com/packages/webtoucher-omnipay-platbox)
```

PHPackages © 2026

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