This library enables you to integrate EBANX with any PHP application.

Requirements

  • PHP >= 5.3
  • cURL

Installation

Composer

The EBANX library is available on Packagist, therefore you can install it by simply updating your composer.json file:

{
  "require" : {
    "ebanx/ebanx": "dev-master"
  }
}

After that run composer install and wait for it to finish. Include the Composer generated autoloader from 'vendor/autoload.php' and you’re ready to use the library.

Git Repository

Clone the git repository anywhere you want and include the EBANX library autoloader from 'src/autoload.php'.

Zip file

You can grab the latest version of the library in a Zip file here. Extract it anywhere you want and include the EBANX library autoloader from ‘src/autoload.php’.

Usage

To use the EBANX PHP library you need to setup your integration key.

EbanxConfig::setIntegrationKey('your-integration-key');

If you need to change other settings, you can use the following function call:

EbanxConfig::set(array(
    'integrationKey' => 'your-integration-key'
  , 'testMode'       => true
));

You can change the following settings:

integrationKey

Your integration key. It will be different in test and production modes.

testMode

Enable or disable the test mode. The default value is false.

directMode

Enable or disable the direct checkout mode. The default value is false.

To create a new API request, just call one of the following methods on the EbanxEbanx class and supply it with the request parameters:

  • EbanxEbanx::doCancel
  • EbanxEbanx::doCapture
  • EbanxEbanx::doExchange
  • EbanxEbanx::doQuery
  • EbanxEbanx::doRefund
  • EbanxEbanx::doRefundOrCancel
  • EbanxEbanx::doRequest
  • doRequest command example:
require_once __DIR__ . 'vendor/autoload.php';

EbanxConfig::setIntegrationKey('6e556ff76e55...56ff7');

$request = EbanxEbanx::doRequest(array(
    'currency_code'     => 'USD'
  , 'amount'            => 119.90
  , 'name'              => 'Jose da Silva'
  , 'email'             => 'jose@example.org'
  , 'payment_type_code' => 'boleto'
  , 'merchant_payment_code' => '10101101'
));

Contributing

Found a bug? Want to add a new feature? Go on and send a pull request to our GitHub repository:

https://github.com/ebanx-integration/ebanx-php