https://github.com/gerencianet/gn-api-sdk-java
SDK em Java integrada a API Gerencianet. Esta SDK está preparada para integração à API Pix e API Boletos da Gerencianet, que lhe permite realizar o gerenciamento de cobranças Pix com QR Code e Pix Copia e Cola, boleto/Bolix, carnê, cartão de crédito e muito mais.
https://github.com/gerencianet/gn-api-sdk-java
assinatura bilet boleto bolix card carne carnet cartao-de-credito java link-de-pagamento marketplace pix pix-copia-e-cola qrcode sdk sdk-java split subscription
Last synced: about 1 month ago
JSON representation
SDK em Java integrada a API Gerencianet. Esta SDK está preparada para integração à API Pix e API Boletos da Gerencianet, que lhe permite realizar o gerenciamento de cobranças Pix com QR Code e Pix Copia e Cola, boleto/Bolix, carnê, cartão de crédito e muito mais.
- Host: GitHub
- URL: https://github.com/gerencianet/gn-api-sdk-java
- Owner: gerencianet
- License: mit
- Created: 2016-09-20T12:26:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-04-14T17:28:06.000Z (almost 3 years ago)
- Last Synced: 2025-07-26T14:46:58.076Z (8 months ago)
- Topics: assinatura, bilet, boleto, bolix, card, carne, carnet, cartao-de-credito, java, link-de-pagamento, marketplace, pix, pix-copia-e-cola, qrcode, sdk, sdk-java, split, subscription
- Language: Java
- Homepage: https://dev.gerencianet.com.br/docs/instalacao-sdk-java
- Size: 72.3 KB
- Stars: 23
- Watchers: 9
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# SDK GERENCIANET FOR JAVA
Sdk for Gerencianet Pagamentos' API.
For more informations about parameters and values, please refer to [Gerencianet](http://gerencianet.com.br) documentation.
**Em caso de dúvidas, você pode verificar a [Documentação](https://docs.gerencianet.com.br) da API na Gerencianet e, necessitando de mais detalhes ou informações, entre em contato com nossa consultoria técnica, via nossos [Canais de Comunicação](https://gerencianet.com.br/central-de-ajuda).**
[](https://travis-ci.org/gerencianet/gn-api-sdk-java)
[](https://coveralls.io/github/gerencianet/gn-api-sdk-java?branch=master)
[](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22br.com.gerencianet.gnsdk%22%20AND%20a%3A%22gn-api-sdk-java%22)
## Requirements
* Java >= 7.0
## Tested with
```
java 7.0 and 8.0
```
## Installation
**Via gradle:**
```gradle
compile 'br.com.gerencianet.gnsdk:gn-api-sdk-java:2.0.0'
```
**Via maven:**
```xml
br.com.gerencianet.gnsdk
gn-api-sdk-java
2.0.0
```
## Getting started
Require the module and packages:
```java
import br.com.gerencianet.gnsdk.Gerencianet;
import br.com.gerencianet.gnsdk.exceptions.GerencianetException;
```
Although the web services responses are in json format, the sdk will convert any server response to a JSONObject or a Map. The code must be within a try-catch and exceptions can be handled as follow:
```
```java
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:
```java
JSONObject options = new JSONObject();
options.put("client_id", "client_id");
options.put("client_secret", "client_secret");
options.put("certificate", "./certs/developmentCertificate.p12");
options.put("sandbox", true);
Gerencianet gn = new Gerencianet($options);
```
Or
```java
Map options = new HashMap();
options.put("client_id", "client_id");
options.put("client_secret", "client_secret");
options.put("certificate", "./certs/developmentCertificate.p12");
options.put("sandbox", true);
Gerencianet gn = new Gerencianet($options);
```
### For production environment
To change the environment to production, just set the third sandbox to false:
```java
JSONObject options = new JSONObject();
options.put("client_id", "client_id");
options.put("client_secret", "client_secret");
options.put("certificate", "./certs/productionCertificate.p12");
options.put("sandbox", false);
Gerencianet gn = new Gerencianet($options);
```
Or
```java
Map options = new HashMap();
options.put("client_id", "client_id");
options.put("client_secret", "client_secret");
options.put("certificate", "./certs/productionCertificate.p12");
options.put("sandbox", false);
Gerencianet gn = new Gerencianet($options);
```
## Running tests
To run the test suite with coverage:
```
mvn clean test jacoco:report
```
## Running examples
To run some existing examples follow the steps described at [gn-api-sdk-java-examples](https://github.com/gerencianet/gn-api-sdk-java-examples).
## Additional Documentation
The full documentation with all available endpoints is in https://dev.gerencianet.com.br/.
## Changelog
[CHANGELOG](CHANGELOG.md)
## License ##
[MIT](LICENSE)