PHPackages                             berarma/cakephp-redsys - 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. berarma/cakephp-redsys

ActiveCakephp-plugin[Payment Processing](/categories/payments)

berarma/cakephp-redsys
======================

Redsys plugin for CakePHP

0.2.2(7y ago)11401[1 PRs](https://github.com/berarma/cakephp-redsys/pulls)GPL-2.0PHPCI failing

Since Jan 22Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/berarma/cakephp-redsys)[ Packagist](https://packagist.org/packages/berarma/cakephp-redsys)[ Docs](https://github.com/berarma/cakephp-redsys)[ RSS](/packages/berarma-cakephp-redsys/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (5)Dependencies (2)Versions (9)Used By (0)

Redsýs plugin for CakePHP
=========================

[](#redsýs-plugin-for-cakephp)

[![Build Status](https://camo.githubusercontent.com/f5c5f97552f88d9231e6e397aad0e2f48b07745d1391f67dacc13b4a0b37e067/68747470733a2f2f7472617669732d63692e636f6d2f62657261726d612f63616b657068702d7265647379732e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/berarma/cakephp-redsys)[![codecov](https://camo.githubusercontent.com/148ef2d89e51451046de7c4a8c874c14bb34c6daf1922217c3577d0ba394e246/68747470733a2f2f636f6465636f762e696f2f67682f62657261726d612f63616b657068702d7265647379732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/berarma/cakephp-redsys)

CakePHP plugin implementing the Redsýs TPV service API.

Requirements
------------

[](#requirements)

- CakePHP 3.4+

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

[](#installation)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org):

```
composer require berarma/cakephp-redsys

```

Use
---

[](#use)

Load the component and configure:

```
$this->loadComponent('Berarma/Redsys.Redsys', [
    // Use 'https://sis.redsys.es/sis/realizarPago' for the real environment
    'url' => 'https://sis-t.redsys.es:25443/sis/realizarPago', // Testing
    'secretKey' => 'QWERTYASDF0123456789',
    'defaults' => [
        'DS_MERCHANT_MERCHANTCODE' => '000000001',
        'DS_MERCHANT_CURRENCY' => '978',
        'DS_MERCHANT_TRANSACTIONTYPE' => '0',
        'DS_MERCHANT_TERMINAL' => '001',
        'DS_MERCHANT_MERCHANTURL' => 'http://example.com/notification',
        'DS_MERCHANT_URLOK' => 'http://example.com/ok',
        'DS_MERCHANT_URLKO' => 'http://example.com/ko',
    ],
]);
```

This is a basic configuration example. The defaults array will be merged with any parameters passed in the requests. Please, read the Redsýs documentation to learn about all the optional parameters that can be used.

Load the helper:

```
$this->loadHelper('Berarma/Redsys.Redsys');
```

Initiating a transaction in the Controller:

```
$this->Redsys->request([
    'DS_MERCHANT_ORDER' => time(),
    'DS_MERCHANT_AMOUNT' => '100',
]);
```

Rendering the form that sends the user to the TPV in the View:

```
