2017 © Pedro PelĂĄez
 

library gerencianet-sdk-php

GN API SDK PHP

image

douglaszuqueto/gerencianet-sdk-php

GN API SDK PHP

  • Friday, October 6, 2017
  • by douglaszuqueto
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

SDK GERENCIANET FOR PHP

Sdk for Gerencianet Pagamentos' API. For more informations about parameters and values, please refer to Gerencianet documentation., (*1)

Build Status Code Climate Test Coverage, (*2)

Installation

Require this package with composer:, (*3)

$ composer require gerencianet/gerencianet-sdk-php

Or include it in your composer.json file:, (*4)

...
"require": {
  "gerencianet/gerencianet-sdk-php": "1.*"
},
...

Requirements

  • PHP >= 5.4

Tested with

php 5.4 and 5.5

Getting started

Require the module and namespaces:, (*5)

require __DIR__ . '/../sdk/vendor/autoload.php';

use Gerencianet\Gerencianet;

Although the web services responses are in json format, the sdk will convert any server response to array. The code must be within a try-catch and exceptions can be handled as follow:, (*6)

try {
  /* code */
} catch(GerencianetException $e) {
  /* Gerencianet's api errors will come here */
} catch(Exception $ex) {
  /* Other errors will come here */
}

For development environment

Instantiate the module passing using your client_id, client_secret and sandbox equals true:, (*7)

$options = [
  'client_id' => 'client_id',
  'client_secret' => 'client_secret',
  'sandbox' => true
];

$api = new Gerencianet($options);

For production environment

To change the environment to production, just set the third sandbox to false:, (*8)

$options = [
  'client_id' => 'client_id',
  'client_secret' => 'client_secret',
  'sandbox' => false
];

$api = new Gerencianet($options);

Running tests

To run tests install PHPUnit and run the following command:, (*9)

$ phpunit -c config.xml

Running examples

Update examples/config.json file with client_id and client_secret of your application., (*10)

You can run using any web server, like Apache or nginx, or simple start a php server as follow:, (*11)

php -S localhost:9000

Then open any example in your browser., (*12)

:warning: Some examples require you to change some parameters to work, like examples/charge/detail.php where you must change the id parameter., (*13)

Additional Documentation

The full documentation with all available endpoints is in https://dev.gerencianet.com.br/., (*14)

License

MIT, (*15)

The Versions

06/10 2017

dev-master

9999999-dev

GN API SDK PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by CecĂ­lia Deveza
by Danniel Hugo
by Francisco Thiene
by Talita Campos
by Thomaz Feitoza