Giter Club home page Giter Club logo

gateway-rede's Introduction

Build Status Code Climate

Payment Gateway - E-Rede

This module provides a interface for communication with the payment gateway E-Rede.

For use this library, you need a install, by using GitHub or use composer.

For use composer, edit your composer.json and add line below:

"lzerma/rede-gateway": "stable"

After install the library, you can use setting a few objects to create a request and after send to the gateway.

Authentication object:

// Auth object
$auth = new Authetication();
$auth->setAcquirerCode("1212121");
$auth->setPassword("###");

In this case, I creating a new object with the acquirer code (providing by E-Rede) and the password (provinding by E-Rede).

Card data Object

// Card object
$card = new Card()

$card->setCardPan("0101010101010101");
$card->setCardExpiryDate("01/15");
$card->setCvc(123);

// In the CartTypes class, exists others methods for configure this object.
$card->setCardMethod(CardTypes::$CARD_TXN_METHOD_AUTH); 

// Set card type operation (Credit ou Debit)
$card->setCardType(CardTypes::$CARD_CREDIT); 

// Country of transaction
$card->setCountry("Brazil"); 

This lines above create a new card object with a many information, like a number of card, expiration date of card, security code of card, etc. You can find in a list of all parameters here.

For use boleto in your integration, you must need write the lines below:

// Boleto object
$boleto->setFirstName("Lucas");
$boleto->setLastName("Zerma");
$boleto->setBillingStret1("No name street, n/a number");
$boleto->setExpiryDate('2013-05-01');
$boleto->setCustomerEmail("lzerma[at]gmail[dot]com");
$boleto->setCustomerIp(192.168.1.1);
$boleto->setInstructions("Few instructions for the bank employer.");
// Here you can set which processor bank you work. A list of all you find on the respective class. 
$boleto->setProcessorId(\Rede\Gateway\Types\Boleto::$PROCESSOR_BANCOBRASIL);

This lines configure one object with all information about the boleto request for sending to gateway e-rede.

ps: This properties listed above is only required properties and the list of all the properties you find here

gateway-rede's People

Contributors

lzerma avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

lucasnpinheiro

gateway-rede's Issues

[Insight] Unused use statement should be avoided - in src/Rede/Gateway/Gateway.php, line 3

in src/Rede/Gateway/Gateway.php, line 3

The class Rede\Gateway\Model\Authetication is declared but never used. You should remove the use statement.

<?php
namespace Rede\Gateway;
use Rede\Gateway\Model\Authetication;
use Rede\Gateway\Model\Card;
use Rede\Gateway\Interfaces\Client;
use Rede\Gateway\Model\Transaction;
use Rede\Gateway\Exceptions\TransactionResult as TransactionResultException; 
use Rede\Gateway\Model\TransactionSuccess;

Posted from SensioLabsInsight

[Insight] Unused use statement should be avoided - in src/…/Model/TransactionDetailsResult.php, line 3

in src/Rede/Gateway/Model/TransactionDetailsResult.php, line 3

The class Rede\Gateway\Exceptions\TransactionResult is declared but never used. You should remove the use statement.

<?php namespace Rede\Gateway\Model;

use Rede\Gateway\Exceptions\TransactionResult;
/**
 * 
 * @author Lucas Zerma - <[email protected]>
 * @since 01/04/2014
 * @project www.lucaszerma.com/eredegw

Posted from SensioLabsInsight

[Insight] Unused use statement should be avoided - in src/Rede/Gateway/Gateway.php, line 4

in src/Rede/Gateway/Gateway.php, line 4

The class Rede\Gateway\Model\Card is declared but never used. You should remove the use statement.

<?php
namespace Rede\Gateway;
use Rede\Gateway\Model\Authetication;
use Rede\Gateway\Model\Card;
use Rede\Gateway\Interfaces\Client;
use Rede\Gateway\Model\Transaction;
use Rede\Gateway\Exceptions\TransactionResult as TransactionResultException; 
use Rede\Gateway\Model\TransactionSuccess;
use Rede\Gateway\Model\TransactionError;

Posted from SensioLabsInsight

[Insight] Commented code should not be commited - in src/Rede/Gateway/Gateway.php, line 61

in src/Rede/Gateway/Gateway.php, line 61

Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    public function send() {
        $this->xml_string = "<Request version='2'>";
        $this->xml_string .= $this->getRequest()->getAuth()->getXml();
        $this->xml_string .= $this->getRequest()->getTransaction()->getXml();
        $this->xml_string .= "</Request>";
//      header("Content-type: text/xml");
//      die($this->xml_string);
        $this->getClient()->add($this->xml_string);
        $this->getClient()->send();
        $this->setTransactionResult($this->getClient()->getResponse());
        return $this->getTransactionResult();

Posted from SensioLabsInsight

[Insight] Interfaces names should end with &quot;Interface&quot; - in src/…/Interfaces/TransactionResult.php, line 11

in src/Rede/Gateway/Interfaces/TransactionResult.php, line 11

Interface TransactionResult should be named TransactionResultInterface for better clarity.

 * @since 01/04/2014
 * @project www.lucaszerma.com/eredegw
 * @see https://github.com/lzerma/gateway_rede
 *
 */
interface TransactionResult {

    /**
     * @return TransactionDetailsResult
     */
    public function getTransactionDetailsResult();

Posted from SensioLabsInsight

[Insight] Commented code should not be commited - in src/Rede/Gateway/Gateway.php, line 62

in src/Rede/Gateway/Gateway.php, line 62

Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

        $this->xml_string = "<Request version='2'>";
        $this->xml_string .= $this->getRequest()->getAuth()->getXml();
        $this->xml_string .= $this->getRequest()->getTransaction()->getXml();
        $this->xml_string .= "</Request>";
//      header("Content-type: text/xml");
//      die($this->xml_string);
        $this->getClient()->add($this->xml_string);
        $this->getClient()->send();
        $this->setTransactionResult($this->getClient()->getResponse());
        return $this->getTransactionResult();
    }

Posted from SensioLabsInsight

Elemento DBA no txndetails

Criar a tag dba (Doing Business As) na no objeto complexo TxnDetails para especificar qual é o estabelecimento comercial.

[Insight] Unused use statement should be avoided - in src/Rede/Gateway/Gateway.php, line 7

in src/Rede/Gateway/Gateway.php, line 7

The class Rede\Gateway\Exceptions\TransactionResult is declared but never used. You should remove the use statement.

namespace Rede\Gateway;
use Rede\Gateway\Model\Authetication;
use Rede\Gateway\Model\Card;
use Rede\Gateway\Interfaces\Client;
use Rede\Gateway\Model\Transaction;
use Rede\Gateway\Exceptions\TransactionResult as TransactionResultException; 
use Rede\Gateway\Model\TransactionSuccess;
use Rede\Gateway\Model\TransactionError;
/**
 * 
 * @author Lucas Zerma - <[email protected]>

Posted from SensioLabsInsight

[Insight] Object parameters should be type hinted - in src/Rede/Gateway/Model/CardResult.php, line 54

in src/Rede/Gateway/Model/CardResult.php, line 54

The parameter result, which is an object, should be typehinted.

    /**
     * 
     * @param SimpleXMLElement $result
     */
    public function __construct($result) {
        $this->setCardType($result->Card->card_account_type);
        $this->setAuthCode($result->CardTxn->authcode);
        $this->setCardScheme($result->CardTxn->card_scheme);
        if(isset($result->CardTxn)) {
            $this->setCv2Status($result->CardTxn->Cv2Avs->cv2avs_status);

Posted from SensioLabsInsight

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.