Skip to content

Commit

Permalink
Updated to Guzzle version v7 and PHP 7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermecotaGn committed Mar 23, 2021
1 parent e19c70e commit 1813717
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 19 deletions.
39 changes: 27 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,42 @@
# SDK GERENCIANET FOR PHP
![SDK Gerencianet for PHP](https://media-exp1.licdn.com/dms/image/C4D1BAQH9taNIaZyh_Q/company-background_10000/0/1603126623964?e=2159024400&v=beta&t=coQC_AK70vTYL3NdvbeIaeYts8nKumNHjvvIGCmq5XA)

<h1 align="center">SDK Gerencianet for PHP</h1>

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

[![Build Status](https://travis-ci.org/gerencianet/gn-api-sdk-php.svg)](https://travis-ci.org/gerencianet/gn-api-sdk-php)
[![Code Climate](https://codeclimate.com/github/gerencianet/gn-api-sdk-php/badges/gpa.svg)](https://codeclimate.com/github/gerencianet/gn-api-sdk-php)
[![Test Coverage](https://codeclimate.com/github/gerencianet/gn-api-sdk-php/badges/coverage.svg)](https://codeclimate.com/github/gerencianet/gn-api-sdk-php/coverage)

## Installation
Require this package with [composer](https://getcomposer.org/):
Clone this repository and execute the following command to install the dependencies
```
$ composer require gerencianet/gerencianet-sdk-php
$ composer install
```
Or include it in your composer.json file:

If you already have a project with composer, include the dependency in your composer.json file:
```
...
"require": {
"gerencianet/gerencianet-sdk-php": "3.*"
"gerencianet/gerencianet-sdk-php": "4.*"
},
...
```
Install the dependencies

Or require this package with [composer](https://getcomposer.org/):
```
$ composer install
$ composer require gerencianet/gerencianet-sdk-php
```

## Requirements
* PHP >= 5.6
* PHP >= 7.2
* Guzzle >= 7.0
* Extension ext-simplexml

## Tested with
```
php 5.6 and 7.X
php 7.2 and 7.4
```
## Getting started
Require the module and namespaces:
Expand Down Expand Up @@ -83,7 +88,16 @@ $options = [
$api = new Gerencianet($options);
```

To generate your certificate open a ticket at https://gerencianet.com.br/fale-conosco informing your account number, application name and environment (Homologation/Production). Our team will return with the .p12 certificate for you to consume the endpoints.
**To generate your certificate:** Access the menu API (1)-> Meus Certificados (2) and choose the environment you want the certificate: Produção or Homologação -> click in Novo Certificado (3).
![To generate your certificate](https://app-us-east-1.t-cdn.net/5fa37ea6b47fe9313cb4c9ca/posts/603543f7d1778b2d725dea1e/603543f7d1778b2d725dea1e_85669.png)

**Create a new application to use the Pix API:** Access the menu API (1)-> Minhas Aplicações -> Nova Aplicação(2) -> Ative API Pix (3) and choose the scopes you want to release in Produção e/ou Homologação (remembering that these can be changed later). -> click in Criar Nova aplicação(4).
![Create a new application to use the Pix API](https://t-images.imgix.net/https%3A%2F%2Fapp-us-east-1.t-cdn.net%2F5fa37ea6b47fe9313cb4c9ca%2Fposts%2F603543ff4253cf5983339cf1%2F603543ff4253cf5983339cf1_88071.png?width=1240&w=1240&auto=format%2Ccompress&ixlib=js-2.3.1&s=2f24c7ea5674dbbea13773b3a0b1e95c)


**Change an existing application to use the Pix API:** Access the menu API (1)-> Minhas Aplicações e escolha a sua aplicação (2) -> Editar(Botão laranja) -> Ative API Pix (3) and choose the scopes you want to release in Produção e/ou Homologação. -> click in Atualizar aplicação (4).
![Change an existing application to use the Pix API](https://app-us-east-1.t-cdn.net/5fa37ea6b47fe9313cb4c9ca/posts/603544082060b2e9b88bc717/603544082060b2e9b88bc717_22430.png)


For use in PHP, the certificate must be converted to .pem.
Below you will find example using the OpenSSL command for conversion.
Expand Down Expand Up @@ -112,7 +126,8 @@ Then open any example in your browser.
| --- | --- | --- | --- | --- |
| 1.x | Maintained | `gerencianet/gerencianet-sdk-php` | [v1](https://github.com/gerencianet/gn-api-sdk-php/tree/1.x) | \>= 5.4 |
| 2.x | Maintained | `gerencianet/gerencianet-sdk-php` | [v2](https://github.com/gerencianet/gn-api-sdk-php/tree/2.x) | \>= 5.5 |
| 3.x | Maintained | `gerencianet/gerencianet-sdk-php` | [v3](https://github.com/gerencianet/gn-api-sdk-php) | \>= 5.6 |
| 3.x | Maintained | `gerencianet/gerencianet-sdk-php` | [v3](https://github.com/gerencianet/gn-api-sdk-php/tree/3.x) | \>= 5.6 |
| 4.x | Maintained | `gerencianet/gerencianet-sdk-php` | [v4](https://github.com/gerencianet/gn-api-sdk-php) | \>= 7.2 |

## Additional Documentation

Expand Down
10 changes: 3 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
{
"name": "gerencianet/gerencianet-sdk-php",
"description": "GN API SDK PHP",
"version": "3.1.0",
"version": "4.0.0",
"require": {
"guzzlehttp/guzzle": "^6.0.0",
"php": ">=5.6.0"
},
"require-dev": {
"codeclimate/php-test-reporter": "^0.1.2",
"phpunit/phpunit": "~4.6"
"guzzlehttp/guzzle": "^7.0",
"php": ">=7.2"
},
"license": "MIT",
"authors": [{
Expand Down

0 comments on commit 1813717

Please # to comment.