PHPackages                             smartdog23/gerencianet-sdk-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. smartdog23/gerencianet-sdk-php

ActiveLibrary[API Development](/categories/api)

smartdog23/gerencianet-sdk-php
==============================

GN API SDK PHP

3.0.0(5y ago)06MITPHPPHP &gt;=5.6.0

Since May 28Pushed 5y agoCompare

[ Source](https://github.com/smartdog23/gn-api-sdk-php)[ Packagist](https://packagist.org/packages/smartdog23/gerencianet-sdk-php)[ RSS](/packages/smartdog23-gerencianet-sdk-php/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (34)Used By (0)

SDK GERENCIANET FOR PHP
=======================

[](#sdk-gerencianet-for-php)

Sdk for Gerencianet Pagamentos' API. For more informations about parameters and values, please refer to [Gerencianet](http://gerencianet.com.br) documentation.

[![Build Status](https://camo.githubusercontent.com/56a16388ec2c2f041d00ce00ac5d26a0f7fe22d84cd07a6a204478c73dbc082f/68747470733a2f2f7472617669732d63692e6f72672f676572656e6369616e65742f676e2d6170692d73646b2d7068702e737667)](https://travis-ci.org/gerencianet/gn-api-sdk-php)[![Code Climate](https://camo.githubusercontent.com/76601754d3e0d0e7d86c5dc71fa4f915d0b7118367353c1e1c05262625d47afd/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f676572656e6369616e65742f676e2d6170692d73646b2d7068702f6261646765732f6770612e737667)](https://codeclimate.com/github/gerencianet/gn-api-sdk-php)[![Test Coverage](https://camo.githubusercontent.com/5330b1e663217e5b9cfd827abcf74041d6acc26051e99547e445a7addb877c6e/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f676572656e6369616e65742f676e2d6170692d73646b2d7068702f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/gerencianet/gn-api-sdk-php/coverage)

Installation
------------

[](#installation)

Require this package with [composer](https://getcomposer.org/):

```
$ composer require gerencianet/gerencianet-sdk-php

```

Or include it in your composer.json file:

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

```

Install the dependencies

```
$ composer install

```

Requirements
------------

[](#requirements)

- PHP &gt;= 5.6
- Extension ext-simplexml

Tested with
-----------

[](#tested-with)

```
php 5.6 and 7.X

```

Getting started
---------------

[](#getting-started)

Require the module and namespaces:

```
require __DIR__ . '/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:

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

To begin, you must configure the parameters in the config.json file. Instantiate the information `client_id`, `client_secret` for your application and `sandbox` equal to *true*, if your environment is Homologation, or *false*, if it is Production. If you use Pix charges, inform in the attribute `pix_cert` the directory and name of your certificate in .pem format.

### For development environment

[](#for-development-environment)

Instantiate the module passing using your client\_id, client\_secret and sandbox equals true:

```
$options = [
  'client_id' => 'client_id',
  'client_secret' => 'client_secret',
  'pix_cert' => '../certs/developmentCertificate.pem',
  'sandbox' => true,
  'debug' => false,
  'timeout' => 30
];

$api = new Gerencianet($options);
```

### For production environment

[](#for-production-environment)

To change the environment to production, just set the third sandbox to false:

```
$options = [
  'client_id' => 'client_id',
  'client_secret' => 'client_secret',
  'pix_cert' => '../certs/productionCertificate.pem',
  'sandbox' => false,
  'debug' => false,
  'timeout' => 30
];

$api = new Gerencianet($options);
```

To generate your certificate open a ticket at  informing your account number, application name and environment (Homologation/Production). Our team will return with the .p12 certificate for you to consume the endpoints.

For use in PHP, the certificate must be converted to .pem. Below you will find example using the OpenSSL command for conversion.

### Command OpenSSL

[](#command-openssl)

```
// Gerar certificado e chave em único arquivo
openssl pkcs12 -in certificado.p12 -out certificado.pem -nodes

```

Running examples
----------------

[](#running-examples)

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

```
php -S localhost:9000
```

Then open any example in your browser.

⚠️ Some examples require you to change some parameters to work, like `examples/charge/oneStepBillet.php` or `examples/pix/charge/create.php` where you must change the id parameter.

Version Guidance
----------------

[](#version-guidance)

VersionStatusPackagistRepoPHP Version1.xMaintained`gerencianet/gerencianet-sdk-php`[v1](https://github.com/gerencianet/gn-api-sdk-php/tree/1.x)&gt;= 5.42.xMaintained`gerencianet/gerencianet-sdk-php`[v2](https://github.com/gerencianet/gn-api-sdk-php/tree/2.x)&gt;= 5.53.xMaintained`gerencianet/gerencianet-sdk-php`[v3](https://github.com/gerencianet/gn-api-sdk-php)&gt;= 5.6Additional Documentation
------------------------

[](#additional-documentation)

The full documentation with all available endpoints is in .

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~69 days

Recently: every ~192 days

Total

31

Last Release

1914d ago

Major Versions

1.0.14 → 2.0.02017-06-22

1.0.15 → 2.2.02018-07-10

1.0.16 → 2.3.02019-01-03

1.x-dev → 2.4.02019-08-28

2.4.1 → 3.0.02021-02-11

PHP version history (4 changes)0.1.0PHP &gt;=5.3.0

0.2.1PHP &gt;=5.5.0

1.0.6PHP &gt;=5.4.0

3.0.0PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/836de007641ccd0805166235326652b57e9a53d329792738c3e58726ff519208?d=identicon)[valdirpl](/maintainers/valdirpl)

---

Top Contributors

[![ceciliadeveza](https://avatars.githubusercontent.com/u/2746797?v=4)](https://github.com/ceciliadeveza "ceciliadeveza (46 commits)")[![dannielhugo](https://avatars.githubusercontent.com/u/4249245?v=4)](https://github.com/dannielhugo "dannielhugo (22 commits)")[![FilipeMata](https://avatars.githubusercontent.com/u/10949632?v=4)](https://github.com/FilipeMata "FilipeMata (9 commits)")[![talitacampos](https://avatars.githubusercontent.com/u/2728950?v=4)](https://github.com/talitacampos "talitacampos (8 commits)")[![SadyCoimbraEfi](https://avatars.githubusercontent.com/u/55587938?v=4)](https://github.com/SadyCoimbraEfi "SadyCoimbraEfi (5 commits)")[![WhinterGoncalves](https://avatars.githubusercontent.com/u/22505756?v=4)](https://github.com/WhinterGoncalves "WhinterGoncalves (4 commits)")[![guilhermecotaGn](https://avatars.githubusercontent.com/u/75252715?v=4)](https://github.com/guilhermecotaGn "guilhermecotaGn (3 commits)")[![franciscotfmc](https://avatars.githubusercontent.com/u/1483404?v=4)](https://github.com/franciscotfmc "franciscotfmc (2 commits)")[![mariopacio](https://avatars.githubusercontent.com/u/5333657?v=4)](https://github.com/mariopacio "mariopacio (1 commits)")[![mpmnicolau](https://avatars.githubusercontent.com/u/1793450?v=4)](https://github.com/mpmnicolau "mpmnicolau (1 commits)")[![giovani-felipe](https://avatars.githubusercontent.com/u/37030674?v=4)](https://github.com/giovani-felipe "giovani-felipe (1 commits)")[![Thiagogresende](https://avatars.githubusercontent.com/u/36145611?v=4)](https://github.com/Thiagogresende "Thiagogresende (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/smartdog23-gerencianet-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/smartdog23-gerencianet-sdk-php/health.svg)](https://phpackages.com/packages/smartdog23-gerencianet-sdk-php)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
