2017 © Pedro Peláez
 

library redsys-virtual-pos

Redsys Virtual POS is an unofficial standalone PHP library to handle payments through the spanish payment service Redsys.

image

nkm/redsys-virtual-pos

Redsys Virtual POS is an unofficial standalone PHP library to handle payments through the spanish payment service Redsys.

  • Wednesday, April 19, 2017
  • by Javi
  • Repository
  • 2 Watchers
  • 4 Stars
  • 70 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

Redsys Virtual POS

Build Status Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Redsys Virtual POS is an unofficial standalone PHP library to handle payments through the spanish payment service Redsys., (*2)

NOTE: This library its still under development and its functionality is subject to change., (*3)

Prerequisites

  • PHP >=5.4.0 <8.0

Installation

Installation is recommended through Composer., (*4)

$ composer require bahiazul/redsys-virtual-pos

Sample

Go to the sample folder an run the following command in a terminal to start PHP's built-in web server:, (*5)

# install dependencies
$ composer install

# start the server
$ php -S 0.0.0.0:8000

Then open your browser and go to here., (*6)

If you want to test the online (async) response, replace localhost with your public IP or hostname, making sure that your machine is accesible through the port 8000 (you can use another port if you want)., (*7)

Usage

Basic usage:, (*8)

use Bahiazul\RedsysVirtualPos\Message\WebRequest;
use Bahiazul\RedsysVirtualPos\Field\Currency;
use Bahiazul\RedsysVirtualPos\Field\TransactionType;

$secret       = 'Mk9m98IfEblmPfrpsawt7BmxObt98Jev';
$merchantCode = '999008881';
$terminal     = '871';

// The Environment object holds connection details
$env = new Bahiazul\RedsysVirtualPos\Environment\DevelopmentEnvironment();
$env->setSecret($secret);

// Setup the Parameters for the Request
$params['Amount']             = '145'; // €1,45
$params['Order']              = strval(time());
$params['MerchantCode']       = $merchantCode;
$params['Currency']           = Currency::EUR;
$params['TransactionType']    = TransactionType::STANDARD;
$params['Terminal']           = $terminal;
$params['MerchantName']       = 'Test Store';                        // optional
$params['ProductDescription'] = 'Product Description';               // optional
$params['UrlOk']              = 'http://localhost:8000/success.php'; // optional
$params['UrlKo']              = 'http://localhost:8000/failure.php'; // optional

// Generate the Request
$webRequest = new WebRequest($env);
$webRequest->setParams($params);

// Generate the form
$submitBtn = "<p><input type='submit' value='Submit'></p>";
$wrForm = $webRequest->getForm([], $submitBtn);

// Render the HTML form w/ Submit button
echo $wrForm;

See sample/index.php and sample/response.php for more detailed examples., (*9)

Test

Run the following command in a terminal:, (*10)

# install dependencies
$ composer install

# run the tests
$ phpunit

Changelog

See CHANGELOG.md, (*11)

Authors

License

MIT, (*12)

The Versions

19/04 2017

dev-master

9999999-dev

Redsys Virtual POS is an unofficial standalone PHP library to handle payments through the spanish payment service Redsys.

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4.0

 

The Development Requires

xml payment html web virtual pos redsys tpv sermepa refund pago lacaixa pasarela sabadell devolucion

19/04 2017

v0.3.4

0.3.4.0

Redsys Virtual POS is an unofficial standalone PHP library to handle payments through the spanish payment service Redsys.

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4.0

 

The Development Requires

xml payment html web virtual pos redsys tpv sermepa refund pago lacaixa pasarela sabadell devolucion

26/04 2016

v0.3.3

0.3.3.0

Redsys Virtual POS is an unofficial standalone PHP library to handle payments through the spanish payment service Redsys.

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4.0

 

The Development Requires

xml payment html web virtual pos redsys tpv sermepa refund pago lacaixa pasarela sabadell devolucion

01/11 2015

v0.3.2

0.3.2.0

Redsys Virtual POS is an unofficial standalone PHP library to handle payments through the spanish payment service Redsys.

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4.0

 

The Development Requires

xml payment html web virtual pos redsys tpv sermepa refund pago lacaixa pasarela sabadell devolucion

30/10 2015

v0.3.1

0.3.1.0

Redsys Virtual POS is an unofficial standalone PHP library to handle payments through the spanish payment service Redsys.

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4.0

 

The Development Requires

xml payment html web virtual pos redsys tpv sermepa refund pago lacaixa pasarela sabadell devolucion

30/10 2015

v0.3.0

0.3.0.0

Redsys Virtual POS is an unofficial standalone PHP library to handle payments through the spanish payment service Redsys.

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4.0

 

The Development Requires

xml payment html web virtual pos redsys tpv sermepa refund pago lacaixa pasarela sabadell devolucion

29/10 2014

v0.2.0

0.2.0.0

Redsys Virtual POS is an unofficial standalone PHP library to handle payments through the spanish payment service Redsys.

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4.0

 

The Development Requires

xml payment html web virtual pos redsys tpv sermepa refund pago lacaixa pasarela sabadell devolucion

27/10 2014

v0.1.3.1

0.1.3.1

Redsys Virtual POS is an unofficial standalone PHP library to handle payments through the spanish payment service Redsys.

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4.0

 

The Development Requires

xml payment html web virtual pos redsys tpv sermepa refund pago lacaixa pasarela sabadell devolucion

27/10 2014

v0.1.3

0.1.3.0

Redsys Virtual POS is an unofficial standalone PHP library to handle payments through the spanish payment service Redsys.

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4.0

 

The Development Requires

xml payment html web virtual pos redsys tpv sermepa refund pago lacaixa pasarela sabadell devolucion

21/10 2014

v0.1.2

0.1.2.0

Redsys Virtual POS is an unofficial standalone PHP library to handle payments through the spanish payment service Redsys.

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4.0

 

The Development Requires

xml payment html web virtual pos redsys tpv sermepa refund pago lacaixa pasarela sabadell devolucion

20/10 2014

v0.1.1

0.1.1.0

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4.0

 

The Development Requires

xml payment html web virtual pos redsys tpv sermepa refund pago lacaixa pasarela sabadell devolucion

20/10 2014

v0.1.0

0.1.0.0

  Sources   Download

BSD-3-Clause

The Requires

  • php >= 5.4.0

 

The Development Requires

xml payment html web virtual pos redsys tpv sermepa refund pago lacaixa pasarela sabadell devolucion