A PHP client to use the E-Rede Acquiring Web Service.
PHP 5.3.3 and later.
You can install the bindings via Composer. Add this to your composer.json
:
{
"require": {
"rede/acquiring": "1.0.1"
}
}
Then install via:
composer.phar install
To use the bindings, use Composer's autoload:
require_once('vendor/autoload.php');
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');
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;
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);
Find more details about how to use this library
Please see https://www.userede.com.br/desenvolvedores for up-to-date documentation
In order to run tests first install PHPUnit via Composer:
composer.phar update --dev
To run the test suite:
./vendor/bin/phpunit