rede/acquiring

This package is abandoned and no longer maintained. No replacement package was suggested.

E-Rede Acquiring PHP Library

v1.0.2 2015-08-01 15:09 UTC

This package is not auto-updated.

Last update: 2016-09-15 18:03:15 UTC


README

A PHP client to use the E-Rede Acquiring Web Service.

Code Climate Test Coverage wercker status

Requirements

PHP 5.3.3 and later.

Composer

You can install the bindings via Composer. Add this to your composer.json:

{
  "require": {
    "rede/acquiring": "1.0.2"
  }
}

Then install via:

composer.phar install

To use the bindings, use Composer's autoload:

require_once('vendor/autoload.php');

Manual Installation

If you do not wish to use Composer, you can download the latest release. Then, to use the bindings, include the init.php file.

require_once('/path/to/erede-acquiring/init.php');

Getting Started

In order to increase the readability we suggest to declare the code below on the top of your file

use \ERede\Acquiring\Acquirer;
use \ERede\Acquiring\TransactionType;

20 seconds tutorial

The simplest way to do a payment using the E-Rede Acquiring Web Service is using this code

$data = array('credit_card' => '4242424242424242', 'exp_month' => 5, 'exp_year' => 2015, 'amount' => '1050', 'reference' => '1234', 'capture' => true);
$acquirer = new Acquirer("FILIATION", "PASSWORD");
$response = $acquirer->fetch(TransactionType::CREDIT)->authorize($data);
print_r($response);

Next steps

Find more details about how to use this library

E-Rede Acquiring Web Service Documentation

Please see https://www.userede.com.br/desenvolvedores for up-to-date documentation

Tests

In order to run tests first install PHPUnit via Composer:

composer.phar update --dev

To run the test suite:

./vendor/bin/phpunit