PHPackages                             dawid-daweb/yii2-przelewy24 - 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. dawid-daweb/yii2-przelewy24

ActiveLibrary[Payment Processing](/categories/payments)

dawid-daweb/yii2-przelewy24
===========================

Yii2 support for przelewy24

01.3k1PHP

Since Mar 3Pushed 9y ago1 watchersCompare

[ Source](https://github.com/dawid-bednarz/yii2-przelewy24)[ Packagist](https://packagist.org/packages/dawid-daweb/yii2-przelewy24)[ RSS](/packages/dawid-daweb-yii2-przelewy24/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

yii2-przelewy24
===============

[](#yii2-przelewy24)

yii2 support for przelewy24

Install
=======

[](#install)

```
„require”: {

   "dawid-daweb/yii2-przelewy24" : "dev-master"
}
```

Add to config section components:

```
    'components' => [
        'P24Service' => [
            'class' => 'daweb\przelewy24\P24Service',
            'clientID' => 11111,
            'sandboxSalt' => '1c323rewr24',
            'salt' => '7aa35rg456hb4d6',
            'currency' => 'PLN',
            'testMode' => true // enable sandbox mode
        ],
    ]
```

Example
=======

[](#example)

Prepare form

```
        $p24Service = \Yii::$app->P24Service;

        $p24Form = $p24Service->getModelForm();

        $p24Form->setAttributes([
            'p24_amount' => 5000,
            'p24_description' => 'Zapłata za subskrypcje',
            'p24_session_id' => '234234fsf8384h45ht84t8g',
            'p24_email' => 'example@email.com',
            'p24_url_status' => Url::to(['payment/update-status'], true),
            'p24_url_return' => Url::to(['site/index'], true)
            // if you need you can put other input
        ]);

        if ($p24Form->validate() && $p24Service->testConnection()) {

            $p24Form->createSigin(); // create and add to p24_sign input
        }

        return $this->renderPartial('payment_form', [
                    'p24Form' => $p24Form
                    ]);
```

In view

```
