PHPackages                             macklus/yii2-redsys-tpv - 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. macklus/yii2-redsys-tpv

ActiveYii2-extension

macklus/yii2-redsys-tpv
=======================

Manage payment form generator from RedSys TPV

1470

Since Apr 4Pushed 9y ago1 watchersCompare

[ Source](https://github.com/macklus/yii2-redsys-tpv)[ Packagist](https://packagist.org/packages/macklus/yii2-redsys-tpv)[ RSS](/packages/macklus-yii2-redsys-tpv/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Redsys Tpv plugin
=================

[](#redsys-tpv-plugin)

Manage payment form generator from Redsys TPV

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist macklus/yii2-redsys-tpv "*"

```

or add

```
"macklus/yii2-redsys-tpv": "*"

```

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

Configure
---------

[](#configure)

Configure tpv component, using:

```
'redsys' => [
            'class' => 'macklus\RedsysTpv\Tpv',
            'mode' => 'prod',
            'debug' => [
                'Merchant' => '0XXXXXXXX',
                'Terminal' => '0000000X',
                'Key' => 'XXXXXXXX',
                'URL_OK' => '',
                'URL_NOK' => '',
				'Version' => '',
            ],
            'prod' => [
                'Merchant' => '0XXXXXXXX',
                'Terminal' => '0000000X',
                'Key' => 'XXXXXXXX',
                'URL_OK' => '',
                'URL_NOK' => '',
				'Version' => '',
            ],
        ],
```

The **mode** variable define usage mode, so far:

1. **prod:** production mode
2. **debug:** debug mode

Generate the payment form
-------------------------

[](#generate-the-payment-form)

You can generate the payment form using next code in your view:

```

```

- **Num\_operation:** Alphanumeric code who identifies this order
- **Importe:** The total amount of payment
- **TipoMoneda:** Coin
- **Idioma:** Language
- **showButton:** if true, the form include submit button. If false, you should submit it througt javascript. Remember that form id is always ceca-tpv-form

Handle TPV response
-------------------

[](#handle-tpv-response)

Once you have been pay, TPV should POST payment info (if you configure it). To handle that, you should use in your action:

```
