Skip to content

A PHP client to use Rede (old Redecard) Payment Web Service

License

Notifications You must be signed in to change notification settings

luangarcia/erede-acquiring-php

 
 

Repository files navigation

E-Rede Acquiring PHP Library

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.1"
  }
}

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

About

A PHP client to use Rede (old Redecard) Payment Web Service

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%