2017 © Pedro PelĂĄez
 

cakephp-plugin cakephp-redsys

CakePHP Redsys Plugin

image

berarma/cakephp-redsys

CakePHP Redsys Plugin

  • Monday, January 22, 2018
  • by berarma
  • Repository
  • 2 Watchers
  • 1 Stars
  • 38 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 6 % Grown

The README.md

Redsýs plugin for CakePHP

Build Status codecov, (*1)

CakePHP plugin implementing the Redsýs TPV service API., (*2)

Requirements

  • CakePHP 3.4+

Installation

You can install this plugin into your CakePHP application using composer:, (*3)

composer require berarma/cakephp-redsys

Use

Load the component and configure:, (*4)

$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., (*5)

Load the helper:, (*6)

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

Initiating a transaction in the Controller:, (*7)

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

Rendering the form that sends the user to the TPV in the View:, (*8)

<?php echo $this->Redsys->renderForm(['id' => 'redsys-form']); ?>
<?php echo $this->Html->scriptBlock('document.getElementById("redsys-form").submit();'); ?>

Getting the response in the Controller:, (*9)

$response = $this->Redsys->response();

The parameters from the response can then be accessed with:, (*10)

$response->get('DS_ORDER');

Case sensitivity of parameters

The specification states that parameter names should use upper case or a mixed style of CamelCase and underline characters. Since the mixed CamelCase/underline style is confusing to say the least, and having 2 different naming styles adds to the confusion, I've decided to use the upper case style everywhere. That means all parameter names feeded to this plugin are converted to upper case, it doesn't matter how they were., (*11)

TODO

This plugin is a work in progress. You should expect compatibility breaking changes., (*12)

License

This plugin is licensed under the GPL v2 license. Most common uses of this plugin won't constitute a derived work, thus, you may use it and include it in your app independently of the license you've choosen for your code as long as the plugin itself is still distributed with its original license. But using this plugin from another plugin that provides modified or improved functionality may constitute a derived work and thus require you to use the same license for your plugin., (*13)

The Versions

22/01 2018

dev-cakephp2

dev-cakephp2 https://github.com/berarma/cakephp-redsys

CakePHP Redsys Plugin

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Bernat Arlandis

cakephp payments card redsys tpv servired

22/01 2018

0.1.0

0.1.0.0 https://github.com/berarma/cakephp-redsys

CakePHP Redsys Plugin

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Bernat Arlandis

cakephp payments card redsys tpv servired

22/01 2018

dev-master

9999999-dev https://github.com/berarma/cakephp-redsys

Redsys plugin for CakePHP

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Bernat Arlandis

cakephp payments card redsys tpv servired

22/01 2018

0.2.0

0.2.0.0 https://github.com/berarma/cakephp-redsys

Redsys plugin for CakePHP

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Bernat Arlandis

cakephp payments card redsys tpv servired