gerencia_net_plus

Last updated:

0 purchases

gerencia_net_plus Image
gerencia_net_plus Images
Add to Cart

Description:

gerencia net plus

gerencia_net_plus #
A Dart plugin that allows a better way to connect to Gerencianet - Efí Api.
Go to:

Getting Started

How to get Client_Id and Client_Secret credentials
How to generate a Pix certificate
How to convert a Pix certificate
Add the certificate and private key to your project
How to register Pix keys


Usage
Examples
Additional Documentation
License

Features #

Create, update and list your Pix Charges, with or without additional expiration fees.
List Pix transactions.
Create a QRCode, Pix copy and paste, and a link to view the QRCode.

TODO:

Webhook functionality

Getting started #
Add gerencia_net_plus as a dependency in your pubspec.yaml file.
How to obtain Client-Id and Client-Secret credentials #
Create a new application to use the Gerencianet API

Access the Gerencianet dashboard and navigate to the API section.
On the left side, click on My Applications (Minhas Aplicações) and then New Application (Nova Aplicação).
Enter a name for the application, enable the Payments API (Boletos e Carnês) and Pix API, and choose the scopes you want to authorize for Production and/or Homologation according to your needs (remember that these can be changed later).
Click on Create New Application (Criar Nova aplicação).


Modify an existing application to use the Gerencianet API

Access the Gerencianet dashboard and navigate to the API section.
On the left side, click on My Applications (Minhas Aplicações), choose your application, and click on the Edit (Editar) button (orange button).
Enable the Pix API and choose the scopes you want to authorize for Production and/or Homologation according to your needs (remember that these can be changed later).
Click on Update Application.


How to generate a Pix certificate #
All Pix requests must contain a security certificate provided by Gerencianet within your account, in PFX (.p12) format. This requirement is fully described in the PIX Security Manual.
To generate your certificate:

Access the Gerencianet dashboard and navigate to the API section.
On the left side, click on My Certificates and choose the environment in which you want the certificate: Production or Homologation.
Click on New Certificate.


How to convert a Pix certificate #
⚠️To use it in Flutter, the certificate must be converted to .pem format, and it is necessary to create a private key for the certificate.
You can download the certificate converter provided by Gerencianet.
Or use the example below by running the OpenSSL command for conversion.
OpenSSL Command
# Generate separate certificate and key
openssl pkcs12 -in path.p12 -out newfile.crt.pem -clcerts -nokeys #certificate
openssl pkcs12 -in path.p12 -out newfile.key.pem -nocerts -nodes #private key
copied to clipboard
Add the certificate and private key to your project #
In the root of your project, create a new folder called certificates and put your newly created certificate and private key inside.
├── certificates
│ ├── private_key.pem
│ ├── certificate.pem
├── lib
│ ├── src
│ └── main.dart
├── .gitignore
├── analysis_options.yaml
└── pubspec.yaml
copied to clipboard
If you are using Flutter
if you are using Flutter with this library, you also need to add your certificates folder to the assets configuration in your pubspec.yaml file.
flutter:
assets:
- certificates/
copied to clipboard
How to register Pix keys #
The registration of Pix keys can be done through the Gerencianet mobile application or through an API endpoint. Below are the steps to register them.
Register Pix key through the mobile application
If you haven't installed our application yet, click on Android or iOS, according to your smartphone's operating system, to download it.
To register your Pix keys through the application:

Access your account through the Gerencianet app.
In the side menu, tap on Pix to start the registration.
Read the information displayed on the screen and click on Register Key (Registrar Chave).
If this is not your first registration, tap on My Keys (Minhas Chaves) and then on the icon (➕).
Select the data you want to register as your Pix Key and tap Next (avançar) – you must choose at least 1 of the 4 available key options (phone number, email, CPF, and/or random key).
After registering the desired Pix keys, click on Finish (concluir).
Done! Your keys are now registered with us.

Usage #
import 'package:gerencia_net_plus/gerencia_net_plus.dart';

final certificateBytes = File('certificates/my_application_certificate.crt.pem').readAsBytesSync();
final privateKeyBytes = File('certificates/my_application_private_key.key.pem').readAsBytesSync();

final gerenciaNetPlus = GerenciaNetPlus(
credentials: GerenciaNetCredentials(
clientId: 'Client_Id',
clientSecret: 'Client_Secret',
certificateBytes: certificateBytes,
privateKeyBytes: privateKeyBytes,
pixKey: 'pixKey',
sandbox: true,
),
);

final newCharge = await gerenciaNetPlus.pix.immediateCharge.createCharge(value: 100);
copied to clipboard
Examples #
You can check all the available examples by clicking here.
Additional Documentation #
Project's Github: https://github.com/cardosoOReis/gerencia_net_plus;
GerenciaNet Api documentation: https://dev.gerencianet.com.br/docs;
Official Gerencia Net Discord: https://discord.com/invite/ptGHMtczcV;
License #
BSD 3-clause

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.