GithubHelp home page GithubHelp logo

luangarcia / erede-acquiring-php Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hgflima/erede-acquiring-php

0.0 2.0 0.0 320 KB

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

License: MIT License

PHP 100.00%

erede-acquiring-php's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.