PHPackages                             nikitakls/yii2-unitpay-gate - 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. nikitakls/yii2-unitpay-gate

ActiveYii2-extension[Payment Processing](/categories/payments)

nikitakls/yii2-unitpay-gate
===========================

UnitPay billing gate

v0.0.3(8y ago)03.0kBSD-3-ClausePHPPHP &gt;=5.4.0

Since Jan 22Pushed 8y ago1 watchersCompare

[ Source](https://github.com/nikitakls/yii2-unitpay-gate)[ Packagist](https://packagist.org/packages/nikitakls/yii2-unitpay-gate)[ RSS](/packages/nikitakls-yii2-unitpay-gate/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (4)Used By (0)

nikitakls/yii2-unitpay-gate
===========================

[](#nikitaklsyii2-unitpay-gate)

Unitpay gate for Yii2

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

[](#installation)

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

Either run

```
composer require --prefer-dist nikitakls/yii2-unitpay-gate "*"

```

or add

```
"nikitakls/yii2-unitpay-gate": "*"

```

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

Configuration
-------------

[](#configuration)

```
'components' => [
    'unitpay' => [
        'class' => '\nikitakls\unitpay\Merchant',
        'secretKey' => '',
        'publicKey' => '',
        'orderCurrency' => 'RUB', # 'EUR', 'UAH', 'BYR', 'USD', 'RUB'
        'locale' => 'ru',
    ]
    ...
]

```

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by :

You can use result action in you controller:

```
class PaymentController extends Controller
{

    public $enableCsrfValidation = false;

    public $unitpay = 'unitpay';

    public function actionInvoice()
    {
        $model = new Invoice();
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            /** @var \nikitakls\unitpay\Merchant $merchant */
            $merchant = Yii::$app->get($this->unitpay);
            return $this->redirect($merchant->payment($model->sum, $model->id, 'Пополнение счета', Yii::$app->user->identity->email, $model->phone));
        } else {
            return $this->render('invoice', [
                'model' => $model,
            ]);
        }
    }

    /**
     * @inheritdoc
     */
    public function actions()
    {

        return [
            'result' => [
                'class' => ResultAction::class,
                'payCallback' => [$this, 'payCallback'],
                'checkCallback' => [$this, 'checkCallback'],
                'failCallback' => [$this, 'failCallback'],
            ],
        ];
    }

    public function payCallback(ResultParam $param)
    {
                $this->loadModel($nInvId)->updateAttributes(['status' => Invoice::STATUS_ACCEPTED]);
                return Yii::$app->get('unitpay')->getSuccessResponse('Pay Success');

    }

    public function checkCallback(ResultParam $param)
    {
                if($this->loadModel($nInvId)){
                    return Yii::$app->get('unitpay')->getSuccessResponse('Check Success. Ready to pay.');
                };
                return Yii::$app->get('unitpay')->getErrorResponse('Message about error');
    }

    public function failCallback(ResultParam $param)
    {
                $this->loadModel($nInvId)->updateAttributes(['status' => Invoice::STATUS_FAIL]);
                Yii::$app->errorHandler->logException($param->getErrorMessage());
                return Yii::$app->get('unitpay')->getSuccessHandlerResponse('Error logged');
    }
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Every ~1 days

Total

3

Last Release

3031d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0744a5429c5ad1a48a1723542d9297ed6c777bd03e07127e54bafd2d3017fc07?d=identicon)[nikitakls](/maintainers/nikitakls)

---

Top Contributors

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

---

Tags

billingyii2extension

### Embed Badge

![Health badge](/badges/nikitakls-yii2-unitpay-gate/health.svg)

```
[![Health](https://phpackages.com/badges/nikitakls-yii2-unitpay-gate/health.svg)](https://phpackages.com/packages/nikitakls-yii2-unitpay-gate)
```

###  Alternatives

[yii2mod/yii2-cashier

Yii2 Cashier provides an interface to Stripe's subscription billing services.

467.3k](/packages/yii2mod-yii2-cashier)

PHPackages © 2026

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