-
Notifications
You must be signed in to change notification settings - Fork 0
/
1179cb17.3a9cf94d.js
1 lines (1 loc) · 8.75 KB
/
1179cb17.3a9cf94d.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{109:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return s})),n.d(t,"metadata",(function(){return l})),n.d(t,"rightToc",(function(){return b})),n.d(t,"default",(function(){return p}));var a=n(2),r=n(6),c=(n(0),n(250)),o=n(257),i=n(258),s={id:"c",title:".NET",hide_title:!0,sidebar_label:".NET"},l={id:"Instalacao/c",isDocsHomePage:!1,title:".NET",description:".NET",source:"@site/docs\\Instalacao\\c.md",permalink:"/documentation/docs/Instalacao/c",sidebar_label:".NET"},b=[{value:'Instalando via <a href="https://www.nuget.org/packages/Gerencianet.SDK/">PIP</a>',id:"instalando-via-pip",children:[]},{value:"Instalando via Git",id:"instalando-via-git",children:[]},{value:"Uso B\xe1sico",id:"uso-b\xe1sico",children:[]},{value:"Exemplos",id:"exemplos",children:[]},{value:"Testes",id:"testes",children:[]}],u={rightToc:b};function p(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)("h1",{className:"titulo"},".NET"),Object(c.b)("div",{className:"subtitulo"},Object(c.b)("p",null,"Nossa API \xe9 ",Object(c.b)("a",{href:"https://en.wikipedia.org/wiki/Representational_state_transfer"},"RESTful"),"\ne responde em ",Object(c.b)("a",{href:"https://www.json.org/json-en.html"},"JSON"),". A Gerencianet utiliza ",Object(c.b)("a",{href:"https://oauth.net/"},"OAuth")," para fornecer acesso autorizado \xe0 API.\nNossa SDK de .NET j\xe1 est\xe1 preparada para realizar essa autentica\xe7\xe3o automaticamente."),Object(c.b)("p",null,"A seguir, confira os procedimentos para instala\xe7\xe3o da SDK da Gerencianet em .NET:"),Object(c.b)("br",null),Object(c.b)("h2",{id:"instalando-via-pip"},"Instalando via ",Object(c.b)("a",{href:"https://www.nuget.org/packages/Gerencianet.SDK/"},"PIP")),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"Package Manager")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{}),"PM> Install-Package Gerencianet.SDK -Version 1.0.8\n")),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},".NET Cli")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{}),"> dotnet add package Gerencianet.SDK --version 1.0.8\n")),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"Package Reference")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{}),'<PackageReference Include="Gerencianet.SDK" Version="1.0.8" />\n')),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"Paket CLI")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{}),"> paket add Gerencianet.SDK --version 1.0.8\n")),Object(c.b)("br",null),Object(c.b)("h2",{id:"instalando-via-git"},"Instalando via Git"),Object(c.b)("p",null,"Nossa SDK tamb\xe9m est\xe1 dispon\xedvel em nosso reposit\xf3rio no GitHub para ",Object(c.b)("a",{href:"https://github.com/gerencianet/gn-api-sdk-dotnet"}," dotnet")," e a SDK para ",Object(c.b)("a",{href:"https://github.com/gerencianet/gn-api-sdk-dotnet-core"},"dotnet-core"),"."),Object(c.b)("br",null),Object(c.b)("h2",{id:"uso-b\xe1sico"},"Uso B\xe1sico"),Object(c.b)(o.a,{defaultValue:"c",values:[{label:".NET",value:"c"}],mdxType:"Tabs"},Object(c.b)(i.a,{value:"c",mdxType:"TabItem"},Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-java"}),'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')))),Object(c.b)("br",null),Object(c.b)("h2",{id:"exemplos"},"Exemplos"),Object(c.b)("p",null,"Voc\xea pode executar os exemplos contidos no projeto ",Object(c.b)("inlineCode",{parentName:"p"},"Gerencianet.SDK.Examples")," descomentando as linhas no arquivo ",Object(c.b)("inlineCode",{parentName:"p"},"Program.cs"),"."),Object(c.b)("p",null,"Lembre-se de definir as credenciais corretas dentro de ",Object(c.b)("inlineCode",{parentName:"p"},"Gerencianet.SDK.Examples/Credentials.Settings")," antes de executar."),Object(c.b)("br",null),Object(c.b)("h2",{id:"testes"},"Testes"),Object(c.b)("p",null,"Para executar os testes, crie o ",Object(c.b)("inlineCode",{parentName:"p"},"Gerencianet.SDK.Tests")," e use o ",Object(c.b)("em",{parentName:"p"},"nunit3-console"),"."),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{}),"$ nunit3-console ./Gerencianet.SDK.Tests/bin/Release/Gerencianet.SDK.Tests.dll\n"))))}p.isMDXComponent=!0},250:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},c=Object.keys(e);for(a=0;a<c.length;a++)n=c[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a<c.length;a++)n=c[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=r.a.createContext({}),b=function(e){var t=r.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=b(e.components);return r.a.createElement(l.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},d=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,c=e.originalType,o=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),u=b(n),d=a,m=u["".concat(o,".").concat(d)]||u[d]||p[d]||c;return n?r.a.createElement(m,i(i({ref:t},l),{},{components:n})):r.a.createElement(m,i({ref:t},l))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var c=n.length,o=new Array(c);o[0]=d;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i.mdxType="string"==typeof e?e:a,o[1]=i;for(var l=2;l<c;l++)o[l]=n[l];return r.a.createElement.apply(null,o)}return r.a.createElement.apply(null,n)}d.displayName="MDXCreateElement"},254:function(e,t,n){"use strict";function a(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=a(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}t.a=function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=a(e))&&(r&&(r+=" "),r+=t);return r}},255:function(e,t,n){"use strict";var a=n(0);const r=Object(a.createContext)({tabGroupChoices:{},setTabGroupChoices:()=>{},isAnnouncementBarClosed:!1,closeAnnouncementBar:()=>{}});t.a=r},256:function(e,t,n){"use strict";var a=n(0),r=n(255);t.a=function(){return Object(a.useContext)(r.a)}},257:function(e,t,n){"use strict";var a=n(0),r=n.n(a),c=n(256),o=n(254),i=n(92),s=n.n(i);const l=37,b=39;t.a=function(e){const{block:t,children:n,defaultValue:i,values:u,groupId:p}=e,{tabGroupChoices:d,setTabGroupChoices:m}=Object(c.a)(),[O,f]=Object(a.useState)(i);if(null!=p){const e=d[p];null!=e&&e!==O&&u.some(t=>t.value===e)&&f(e)}const j=e=>{f(e),null!=p&&m(p,e)},g=[];return r.a.createElement("div",null,r.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(o.a)("tabs",{"tabs--block":t})},u.map(({value:e,label:t})=>r.a.createElement("li",{role:"tab",tabIndex:"0","aria-selected":O===e,className:Object(o.a)("tabs__item",s.a.tabItem,{"tabs__item--active":O===e}),key:e,ref:e=>g.push(e),onKeyDown:e=>((e,t,n)=>{switch(n.keyCode){case b:((e,t)=>{const n=e.indexOf(t)+1;e[n]?e[n].focus():e[0].focus()})(e,t);break;case l:((e,t)=>{const n=e.indexOf(t)-1;e[n]?e[n].focus():e[e.length-1].focus()})(e,t)}})(g,e.target,e),onFocus:()=>j(e),onClick:()=>j(e)},t))),r.a.createElement("div",{role:"tabpanel",className:"margin-vert--md"},a.Children.toArray(n).filter(e=>e.props.value===O)[0]))}},258:function(e,t,n){"use strict";var a=n(0),r=n.n(a);t.a=function(e){return r.a.createElement("div",null,e.children)}}}]);