dev-master
9999999-dev https://github.com/berarma/cakephp-sermepaCakePHP Sermepa Plugin
GPL-2.0
The Requires
- php >=5.2.8
- composer/installers *
The Development Requires
by Bernat Arlandis
cakephp payments card tpv servired sermepa
CakePHP Sermepa Plugin
NOTICE: This plugin has been discontinued. The new version is available at https://github.com/berarma/cakephp-redsys., (*2)
With this plugin is possible to do online payments using the Sermepa/RedsĂœs TPV service., (*3)
app/Plugin/Sermepa
app/Config/bootstrap.php
, use CakePlugin::loadAll();
or CakePlugin::load('Sermepa');
Ensure require
is present in composer.json
, you can add it with the
following command:, (*4)
php composer.phar require berarma/cakephp-sermepa
Create your configuration like this:, (*5)
$config = array( 'Sermepa' => array( 'serviceUrl' => 'https://sis-t.redsys.es:25443/sis/realizarPago', // Testing // Use 'https://sis.redsys.es/sis/realizarPago' for the real environment 'extendedSignature' => false, 'merchantName' => 'Merchant Name', 'merchantCode' => '000000001', 'secretKey' => 'QWERTYASDF0123456789', 'terminal' => '001', 'currency' => '978', 'consumerLanguage' => '1', 'merchantUrl' => 'http://example.com/get_notification', ) );
Setting things up in the Controller:, (*6)
public $components = array('Sermepa'); public $helpers = array('Sermepa');
Initiating a transaction in the Controller:, (*7)
$this->Sermepa->createTransaction($orderId, $amount, '0');
Rendering the form that sends the user to the TPV in the View:, (*8)
<?php echo $this->Sermepa->renderForm(array('id' => 'sermepa_form', 'target' => '_blank')); ?> <?php echo $this->Html->scriptBlock('$( "#sermepa_form" ).submit();'); ?>
Getting a notification in the Controller:, (*9)
$notification = $this->Sermepa->getNotification();
See the Test files to find more use examples., (*10)
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., (*11)
CakePHP Sermepa Plugin
GPL-2.0
cakephp payments card tpv servired sermepa