.NET Core

Our API is RESTful and responds in JSON. Gerencianet uses OAuth to provide authorized access to the API. Our NodeJS SDK is already prepared to perform this authentication automatically.

Below, check out the procedures for installing the Gerencianet SDK in .NET Core:


Installing via:

Visual Studio package manager

PM>Install-Package Gerencianet.NETCore.SDK -Version 2.0.1

.NET Cli

>dotnet add package Gerencianet.NETCore.SDK --version 2.0.1

Git

$ git clone https://github.com/gerencianet/gn-api-sdk-dotnet-core.git

Tested with

  • .NET 5.0

Basic use

using Gerencianet.NETCore.SDK;
...
dynamic endpoints = new Endpoints("client_id", "client_secret", true, "production.p12");
var body = new
{
calendario = new {
expiracao = 3600
},
devedor = new {
cpf = "12345678909",
nome = "Francisco da Silva"
},
valor = new {
original = "1.45"
},
chave = "71cdf9ba-c695-4e3c-b010-abb521a3f1be",
solicitacaoPagador = "Enter the order number or identifier."
};
var response = endpoints.PixCreateImmediateCharge(null, body);
Console.WriteLine(response);

Examples

You can run the examples contained in the Gerencianet.NETCore.SDK.Examples directory, uncomment the lines in Program.cs.

Also make sure you enter the credentials correctly in Gerencianet.NETCore.SDK.Examples/credentials.json before running the examples.