{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":".NET","type":"basic","slug":"instalacao-sdk-dotnet","excerpt":"Saiba como instalar e configurar nossa SDK em .NET para API Pix e API Boletos (Bolix)","body":"[block:html]\n{\n  \"html\": \"<p>Nossa API é <a href=\\\"https://en.wikipedia.org/wiki/Representational_state_transfer\\\" target=\\\"_blank\\\" title=\\\"Link Externo\\\">RESTful</a> e responde em <a href=\\\"http://www.json.org/\\\" target=\\\"_blank\\\" title=\\\"Link Externo\\\">JSON</a>. A Gerencianet utiliza <a href=\\\"http://oauth.net/\\\" target=\\\"_blank\\\" title=\\\"Link Externo\\\">OAuth</a> para fornecer acesso autorizado à <abbr title=\\\"Application Programming Interface\\\">API</abbr>. Nossa SDK de .NET já está preparada para realizar essa autenticação automaticamente.</p>\"\n}\n[/block]\nA seguir, confira os procedimentos para instalação da <a href=\"https://github.com/gerencianet/gn-api-sdk-dotnet\" target=\"_blank\" title=\"Link Externo\">SDK da Gerencianet em .NET</a>:\n\n# Instalando via <a href=\"https://www.nuget.org/packages/Gerencianet.SDK/\" target=\"_blank\">NuGet</a>\n\n**Package Manager**\n\n```bash\nPM> Install-Package Gerencianet.SDK -Version 1.0.9\n```\n\n**.NET Cli**\n\n```bash\n> dotnet add package Gerencianet.SDK --version 1.0.9\n```\n\n**PackageReference**\n\n```bash\n<PackageReference Include=\"Gerencianet.SDK\" Version=\"1.0.9\" />\n```\n**Paket CLI**\n\n```bash\n> paket add Gerencianet.SDK --version 1.0.9\n```\n\n# Instalando via Git</a>\nNossa SDK também está disponível em nosso <a href=\"https://github.com/gerencianet/gn-api-sdk-dotnet\" target=\"_blank\">repositório no GitHub</a>.\n\n\n<pre>$ git clone https://github.com/gerencianet/gn-api-sdk-dotnet.git</pre>\n\n<br>\n\n# Testado com\n\n- dotnet <code>4.0.0</code>\n\n# Uso Básico\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"using Gerencianet.SDK;\\n...\\ndynamic endpoints = new Endpoints(\\\"client_id\\\", \\\"client_secret\\\", true);\\nvar body = new\\n{\\n    items = new[] {\\n        new {\\n            name = \\\"Product 1\\\",\\n            value = 1000,\\n            amount = 2\\n        }\\n    },\\n    shippings = new[] {\\n        new {\\n            name = \\\"Default Shipping Cost\\\",\\n            value = 100\\n        }\\n    }\\n};\\n\\nvar response = endpoints.CreateCharge(null, body);\\nConsole.WriteLine(response);\",\n      \"language\": \"asp\",\n      \"name\": \".NET\"\n    }\n  ]\n}\n[/block]\n# Exemplos\n\nVocê pode executar os exemplos contidos no projeto <code>Gerencianet.SDK.Examples</code> descomentando as linhas no arquivo <code>Program.cs</code>.\n\nLembre-se de definir as credenciais corretas dentro de <code>Gerencianet.SDK.Examples/Credentials.Settings</code> antes de executar.\n\n# Testes\n\nPara executar os testes, crie o <code>Gerencianet.SDK.Tests</code> e use o *nunit3-console:*\n\n<pre>$ nunit3-console ./Gerencianet.SDK.Tests/bin/Release/Gerencianet.SDK.Tests.dll</pre>","updates":[],"order":6,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"606f2ca7c5ba910078783484","user":"57601a13af3e090e00108059","version":{"version":"1.1.0","version_clean":"1.1.0","codename":"2021","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["606f2ca6c5ba91007878342b","575af039a083950e004487f7","575af5c7ba4ed70e000ca288","606f2ca6c5ba91007878342c","606f2ca6c5ba91007878342d","606f2ca6c5ba91007878342e","606f2ca6c5ba91007878342f","5761a63d207db7170022fc14","5761b9a2b65324200072d79e","576832939f0bf4190014ffdf","576832c09f0bf4190014ffe1","576832cba151c10e004316f0","576832d5bb15f40e00a288ec","576832e107b1f30e0039c645","606f2ca6c5ba910078783430","606f2ca6c5ba910078783431","5783f78c5cbce30e0074e2b7","606f2ca6c5ba910078783432","606f2ca6c5ba910078783433","606f2ca6c5ba910078783434","606f2ca6c5ba910078783435","606f2ca6c5ba910078783436","606f2ca6c5ba910078783437","578529f887c9280e0090394b","606f2ca6c5ba910078783438","606f2ca6c5ba910078783439","606f2ca6c5ba91007878343a","606f2ca6c5ba91007878343b","606f2ca6c5ba91007878343c","606f2ca6c5ba91007878343d","606f2ca6c5ba91007878343e","606f2ca6c5ba91007878343f","606f2ca6c5ba910078783440","606f2ca6c5ba910078783441","60d61f026ddc3901a32ee5f1","60ec37c637005f015e54174e","61473375119247002a9c14d7"],"_id":"606f2ca7c5ba9100787834c6","project":"575aeffae12cf20e002f306c","createdAt":"2016-06-10T16:51:06.080Z","releaseDate":"2016-06-10T16:51:06.080Z","__v":3,"forked_from":"575aeffae12cf20e002f306f"},"__v":0,"createdAt":"2017-03-10T12:40:03.441Z","parentDoc":null,"project":"575aeffae12cf20e002f306c","githubsync":"","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Instalação da API (SDK's)","slug":"instalação-da-api-sdks","order":7,"from_sync":false,"reference":false,"_id":"606f2ca6c5ba91007878343d","createdAt":"2017-03-10T12:37:05.075Z","project":"575aeffae12cf20e002f306c","version":"606f2ca7c5ba9100787834c6","__v":0}}

.NET

Saiba como instalar e configurar nossa SDK em .NET para API Pix e API Boletos (Bolix)

[block:html] { "html": "<p>Nossa API é <a href=\"https://en.wikipedia.org/wiki/Representational_state_transfer\" target=\"_blank\" title=\"Link Externo\">RESTful</a> e responde em <a href=\"http://www.json.org/\" target=\"_blank\" title=\"Link Externo\">JSON</a>. A Gerencianet utiliza <a href=\"http://oauth.net/\" target=\"_blank\" title=\"Link Externo\">OAuth</a> para fornecer acesso autorizado à <abbr title=\"Application Programming Interface\">API</abbr>. Nossa SDK de .NET já está preparada para realizar essa autenticação automaticamente.</p>" } [/block] A seguir, confira os procedimentos para instalação da <a href="https://github.com/gerencianet/gn-api-sdk-dotnet" target="_blank" title="Link Externo">SDK da Gerencianet em .NET</a>: # Instalando via <a href="https://www.nuget.org/packages/Gerencianet.SDK/" target="_blank">NuGet</a> **Package Manager** ```bash PM> Install-Package Gerencianet.SDK -Version 1.0.9 ``` **.NET Cli** ```bash > dotnet add package Gerencianet.SDK --version 1.0.9 ``` **PackageReference** ```bash <PackageReference Include="Gerencianet.SDK" Version="1.0.9" /> ``` **Paket CLI** ```bash > paket add Gerencianet.SDK --version 1.0.9 ``` # Instalando via Git</a> Nossa SDK também está disponível em nosso <a href="https://github.com/gerencianet/gn-api-sdk-dotnet" target="_blank">repositório no GitHub</a>. <pre>$ git clone https://github.com/gerencianet/gn-api-sdk-dotnet.git</pre> <br> # Testado com - dotnet <code>4.0.0</code> # Uso Básico [block:code] { "codes": [ { "code": "using Gerencianet.SDK;\n...\ndynamic endpoints = new Endpoints(\"client_id\", \"client_secret\", true);\nvar body = new\n{\n items = new[] {\n new {\n name = \"Product 1\",\n value = 1000,\n amount = 2\n }\n },\n shippings = new[] {\n new {\n name = \"Default Shipping Cost\",\n value = 100\n }\n }\n};\n\nvar response = endpoints.CreateCharge(null, body);\nConsole.WriteLine(response);", "language": "asp", "name": ".NET" } ] } [/block] # Exemplos Você pode executar os exemplos contidos no projeto <code>Gerencianet.SDK.Examples</code> descomentando as linhas no arquivo <code>Program.cs</code>. Lembre-se de definir as credenciais corretas dentro de <code>Gerencianet.SDK.Examples/Credentials.Settings</code> antes de executar. # Testes Para executar os testes, crie o <code>Gerencianet.SDK.Tests</code> e use o *nunit3-console:* <pre>$ nunit3-console ./Gerencianet.SDK.Tests/bin/Release/Gerencianet.SDK.Tests.dll</pre>