-
Notifications
You must be signed in to change notification settings - Fork 0
/
21c04fc9.8e9441f1.js
1 lines (1 loc) · 19.4 KB
/
21c04fc9.8e9441f1.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{130:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return c})),n.d(t,"rightToc",(function(){return s})),n.d(t,"default",(function(){return l}));var a=n(2),o=n(6),r=(n(0),n(250)),i={id:"IntroducaoPlayground",title:"Introdu\xe7\xe3o ao Playground",hide_title:!0,sidebar_label:"Playground intro"},c={id:"AmbienteTestes/IntroducaoPlayground",isDocsHomePage:!1,title:"Introdu\xe7\xe3o ao Playground",description:"Playground intro",source:"@site/docs\\AmbienteTestes\\IntroducaoPlayground.md",permalink:"/documentation/docs/AmbienteTestes/IntroducaoPlayground",sidebar_label:"Playground intro",sidebar:"someSidebar",previous:{title:"Limites de Consumo",permalink:"/documentation/docs/VisaoGeral/LimitesConsumo"},next:{title:"Playground Transa\xe7\xf5es",permalink:"/documentation/docs/AmbienteTestes/PlaygroundTransacoes"}},s=[{value:"Explore our sandbox environment",id:"explore-our-sandbox-environment",children:[]},{value:"GET, POST, PUT and DELETE",id:"get-post-put-and-delete",children:[]},{value:"Interpreting API Responses",id:"interpreting-api-responses",children:[]},{value:"Explanatory Videos: Playground",id:"explanatory-videos-playground",children:[{value:"Playground methods (Gerencianet's test environment/sandbox)",id:"playground-methods-gerencianets-test-environmentsandbox",children:[]},{value:"Creating a transaction via Playground (Gerencianet's test environment/sandbox)",id:"creating-a-transaction-via-playground-gerencianets-test-environmentsandbox",children:[]}]},{value:"Next steps",id:"next-steps",children:[]}],b={rightToc:s};function l(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},b,n,{components:t,mdxType:"MDXLayout"}),Object(r.b)("h1",{className:"titulo"},"Playground intro"),Object(r.b)("div",{className:"subtitulo"},Object(r.b)("p",null,"To access the test environment you need a Gerencianet account. ",Object(r.b)("a",{href:"https://gerencianet.com.br/#abrirconta",title:"Cadastro ao nosso sistema, seja nosso cliente",target:"_blank"},"Create account"),"."),Object(r.b)("p",null,"Before using an application in production environment, it is very important to make sure your implementation is correct and your integrations are connected the way they should."),Object(r.b)("p",null,"To prevent integrators from having to test in production, Gerencianet offers a development/testing environment (sandbox), which we call ",Object(r.b)("em",{parentName:"p"},"\u201cPlayground\u201d"),". This is a place where the integrator can use to learn about the payment mechanism in 100% test and uncomplicated environment."),Object(r.b)("p",null,"In this environment, by offering a similarity with the resources supported by the API in the production environment, it is possible to carry out integration tests before going to production, thus being able to experiment with our API without making changes to your Gerencianet account. "),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"Playground... Sandbox... Development environment, what does it mean?")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"It is important to know that the words ",Object(r.b)("strong",{parentName:"p"},"Playground, Sandbox and Development Environment"),", in the Gerencianet context, are synonymous. They refer to the test environment we offer where you can freely test your API integration."),Object(r.b)("p",{parentName:"div"},"Specifically in the case of Playground, it is an online sandbox provided by Gerencianet, so that the integrator can test, quickly and easily, if the data they intend to send to the API are correct and follow the required standard."),Object(r.b)("p",{parentName:"div"},"Using Playground, the integrator does not even need to write lines of code, just be connected to the Internet and logged into your Gerencianet account, copying and pasting the codes that we provide in the following links: Transactions, Carn\xeas, Notifications, Subscriptions and Others. "))),Object(r.b)("br",null),Object(r.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"caution")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"It is important to note that ",Object(r.b)("strong",{parentName:"p"},"boletos generated in sandbox are not valid and cannot be paid"),', they have the typeable line "zero" and a watermark at the bottom stating that it is a test ticket.'),Object(r.b)("p",{parentName:"div"},Object(r.b)("strong",{parentName:"p"},'Payments for sandbox charges using credit card are dummy even if using a "real" card.'),' All card payments in this environment will have the payment confirmed automatically, but this is just a status change to "Paid" . This feature allows you to test the ',Object(r.b)("code",null,"paid")," status notification."),Object(r.b)("p",{parentName:"div"},Object(r.b)("strong",{parentName:"p"},"This means that all payments made in the sandbox are not real and, therefore, there is no financial charge.")," "))),Object(r.b)("p",null,"To start using the Playground, follow the instructions:"),Object(r.b)("ol",null,Object(r.b)("li",null,Object(r.b)("p",null,"Access ",Object(r.b)("a",{href:"http://www.gerencianet.com.br",target:"_blank",title:"Link Externo"},"our website "),", click in ",Object(r.b)("a",{href:"https://gerencianet.com.br/#login",target:"_blank",title:"Link Externo"},'"Entrar"')," (top menu) and log in to your account;")),Object(r.b)("li",null,Object(r.b)("p",null,"Click in ",Object(r.b)("code",null,"API"),", then ",Object(r.b)("code",null,"Minhas Aplica\xe7\xf5es > Nova aplica\xe7\xe3o")," (",Object(r.b)("a",{href:"https://s3.amazonaws.com/gerencianet-pub-prod-1/printscreen/2020/10/20/matheus.rodrigues/c62031-858e9d90-4a53-42d4-8b53-8a1e6de6be17.png",target:"_blank",title:"Link Externo"},"?"),"), defining a name for your application."))),Object(r.b)("p",null,"Being inside the created application, it is possible to observe all the endpoints provided by the API, that is, everything that is possible to do in the integration. Through the Playground, the integrator can know the information that can be sent in each situation, which are required, in which formats they must be sent, etc."),Object(r.b)("p",null,"To follow the procedures performed in the Playground, use the tab ",Object(r.b)("code",null,'"Desenvolvimento"'),", specifically in the subtabs ",Object(r.b)("abbr",{title:"Every charge that is created can be seen in this tab"},'"Transa\xe7\xf5es"'),", ",Object(r.b)("abbr",{title:"List all created subscriptions"},'"Assinaturas"'),", ",Object(r.b)("abbr",{title:"List all created carn\xea"},'"Carn\xeas"'),", ",Object(r.b)("abbr",{title:"Shows all requests from your system, whether successful or failed"},'"Hist\xf3rico de Requisi\xe7\xf5es"')," and ",Object(r.b)("abbr",{title:"Shows every notification sent by the Gerencianet system and the response from the URL that received the POST"},'"Hist\xf3rico de Notifica\xe7\xf5es"'),"."),Object(r.b)("p",null,"Each ",Object(r.b)("em",null,"endpoint")," has an editable field to inform the ",Object(r.b)("abbr",{title:"JSON with the information the endpoint must receive to perform the action"},"input data")," and a non-editable field to show the ",Object(r.b)("abbr",{title:"JSON that describes the structure of the data, including all the information that can be sent and the specificities of each one"},"Schema"),". The ",Object(r.b)("em",null,"endpoints")," are divided into 5 (five) main groups: ",Object(r.b)("code",null,"Trnsaction"),", ",Object(r.b)("code",null,"Carn\xea"),", ",Object(r.b)("code",null,"Notification"),", ",Object(r.b)("code",null,"Subscription")," and ",Object(r.b)("code",null,"Others"),"."),Object(r.b)("br",null),Object(r.b)("h2",{id:"explore-our-sandbox-environment"},"Explore our sandbox environment"),Object(r.b)("p",null,"Gerencianet ffers two ways to use the test environment (sandbox): (a) within your Gerencianet account through the Playground or (b) using your development keys ",Object(r.b)("code",null,"Client_Id")," and ",Object(r.b)("code",null,"Client_Secret"),":"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("p",{parentName:"li"},"(a) The Playground is an isolated environment, similar to the production environment - it's the place in your Gerencianet account where you can test API features online, without having to program. See how:"),Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("a",{href:"https://gerencianet.com.br/#login",target:"_blank",title:"Link Externo"},"Log in")," on your Gerencianet account, access ",Object(r.b)("code",null,"API"),", then ",Object(r.b)("code",null,' "Minhas Aplica\xe7\xf5es" > "Nova aplica\xe7\xe3o"')," (",Object(r.b)("a",{href:"https://s3.amazonaws.com/gerencianet-pub-prod-1/printscreen/2020/10/20/matheus.rodrigues/c62031-858e9d90-4a53-42d4-8b53-8a1e6de6be17.png",target:"_blank",title:"Link Externo"},"?"),"), defining your application's name; and"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("p",{parentName:"li"},"now, you can see how to use our ",Object(r.b)("a",{href:"../AmbienteTestes/IntroducaoPlayground",target:"_blank",title:"Link Interno"},"Playground")," copy the codes provided in the section ",Object(r.b)("a",{href:"../AmbienteTestes/AmbienteTeste",target:"_blank",title:"Link Interno"},"Sandbox environment")," of the documentation and exploit our Playground.")))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("p",{parentName:"li"},"(b) You can also perform integration tests directly on your application/system before going to the production environment. For this, use your keys ",Object(r.b)("code",null,"Client_Id")," and ",Object(r.b)("code",null,"Client_Secret")," in the ",Object(r.b)("code",null,"Desenvolvimento")," tab (",Object(r.b)("a",{href:"https://s3.amazonaws.com/gerencianet-pub-prod-1/printscreen/2020/10/20/matheus.rodrigues/1985d9-6c864d8f-4ba3-4584-b9e7-df4510c189e2.png",target:"_blank",title:"Link Externo"},"?"),"), besides defining ",Object(r.b)("code",null,"sandbox => true"),"."))),Object(r.b)("p",null,"Additionally, we offer videos teaching you more about the API and our Playground: "),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("p",{parentName:"li"},"Video: ",Object(r.b)("a",{href:"https://www.youtube.com/watch?v=oy4aydoLUZA&index=5&list=PLRqvcUTH2VsWKL03a0dUMaPobAKUSXyxt",target:"_blank",title:"Link Externo"},"API Gerencianet"))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("p",{parentName:"li"},"Video: ",Object(r.b)("a",{href:"https://www.youtube.com/watch?v=nKPb0rU8j4Q&index=6&list=PLRqvcUTH2VsWKL03a0dUMaPobAKUSXyxt",target:"_blank",title:"Link Externo"},"Playground Methods (Gerencianet's sanbox environment/tests)"))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("p",{parentName:"li"},"V\xeddeo: ",Object(r.b)("a",{href:"https://www.youtube.com/watch?v=ylqJUpHqwfY&index=7&list=PLRqvcUTH2VsWKL03a0dUMaPobAKUSXyxt",target:"_blank",title:"Link Externo"},"Creating a transaction in the Playground (Gerencianet's sanbox environment/tests)")))),Object(r.b)("br",null),Object(r.b)("h2",{id:"get-post-put-and-delete"},"GET, POST, PUT and DELETE"),Object(r.b)("p",null,"API is RESTful, which means that the ",Object(r.b)("em",{parentName:"p"},"endpoints")," created follow specific practices so that they are intuitive for the integrators that use it. These options (GET, POST, PUT and DELETE) are methods that you will use to interact with the resource."),Object(r.b)("p",null,"Every ",Object(r.b)("em",{parentName:"p"},"endpoint")," of type ",Object(r.b)("strong",{parentName:"p"},"GET")," is a query ",Object(r.b)("em",{parentName:"p"},"endpoint"),", that is, the integrator will never be creating or changing a record when making a consumption of this type."),Object(r.b)("p",null,"The ",Object(r.b)("em",{parentName:"p"},"endpoints")," of type ",Object(r.b)("strong",{parentName:"p"},"POST")," are always related to the creation of some record. ",Object(r.b)("code",null,"POST /v1/charge")," creates a charge; ",Object(r.b)("code",null,"POST /v1/charge/:id/pay")," creates a payment for a given charge, and so on."),Object(r.b)("p",null,"The ",Object(r.b)("em",{parentName:"p"},"endpoints")," of type ",Object(r.b)("strong",{parentName:"p"},"PUT")," perform the alteration of an existing record. When the integrator uses ",Object(r.b)("code",null,"PUT /v1/charge/:id/cancel"),", for example, it is changing the status of a charge to ",Object(r.b)("code",null,"canceled"),"."),Object(r.b)("p",null,"Finally, ",Object(r.b)("em",{parentName:"p"},"endpoints")," of type ",Object(r.b)("strong",{parentName:"p"},"DELETE")," are responsible for deleting a record. This type of consumption will always request an identifier for deletion. In the API, only subscription plans can be deleted. "),Object(r.b)("br",null),Object(r.b)("h2",{id:"interpreting-api-responses"},"Interpreting API Responses"),Object(r.b)("p",null,"Gerencianet uses HTTP responses to indicate success or failure in requests. Generally, when we return responses with status ",Object(r.b)("code",null,"2xx")," it means that the request was successfully sent; the status ",Object(r.b)("code",null,"4xx")," indicates failure in the data sent by the client; the status ",Object(r.b)("code",null,"5xx")," indicates internal server errors ."),Object(r.b)("p",null,"For more details, we have prepared a special section showing how to ",Object(r.b)("a",{href:"../VisaoGeral/InterpretandoErros",title:"Link Interno"},"interpret our API responses "),", with real and practical examples. To make it even easier, we also recorded a very short and objective video. ",Object(r.b)("a",{href:"https://www.youtube.com/watch?v=ad0SYoeGAZs",title:"Link Interno"},"Don't miss it and check it out. "),"."),Object(r.b)("br",null),Object(r.b)("h2",{id:"explanatory-videos-playground"},"Explanatory Videos: Playground"),Object(r.b)("p",null,"Thinking about offering new ways of transmitting information, Gerencianet makes available the following videos in order to explain, in a clear and objective way, how to use our Playground (sandbox). "),Object(r.b)("h3",{id:"playground-methods-gerencianets-test-environmentsandbox"},"Playground methods (Gerencianet's test environment/sandbox)"),Object(r.b)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/nKPb0rU8j4Q",frameborder:"0",allowfullscreen:!0}),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("h3",{id:"creating-a-transaction-via-playground-gerencianets-test-environmentsandbox"},"Creating a transaction via Playground (Gerencianet's test environment/sandbox)"),Object(r.b)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/ylqJUpHqwfY",frameborder:"0",allowfullscreen:!0}),Object(r.b)("p",null,'For access to other classes, on other subjects, access the "Online Integration Course" section.'),Object(r.b)("br",null),Object(r.b)("h2",{id:"next-steps"},"Next steps"),Object(r.b)("p",null,"Now that you know about our Playground, it is interesting that you know more about the 5 (five) endpoints available in our test area: "),Object(r.b)("a",{href:"./PlaygroundTransacoes",target:"_blank",title:"Link Interno"},Object(r.b)("button",{type:"button",className:"buttonModify button1"},"Transaction")),Object(r.b)("a",{href:"./PlaygroundCarne",target:"_blank",title:"Link Interno"},Object(r.b)("button",{type:"button",className:"buttonModify button1"},"Carn\xea")),Object(r.b)("a",{href:"./PlaygroundNotification",target:"_blank",title:"Link Interno"},Object(r.b)("button",{type:"button",className:"buttonModify button1"},"Notification")),Object(r.b)("a",{href:"./PlaygroundAssinaturas",target:"_blank",title:"Link Interno"},Object(r.b)("button",{type:"button",className:"buttonModify button1"},"Subscription")),Object(r.b)("a",{href:"./PlaygroundOutros",target:"_blank",title:"Link Interno"},Object(r.b)("button",{type:"button",className:"buttonModify button1"},"Others"))))}l.isMDXComponent=!0},250:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return h}));var a=n(0),o=n.n(a);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(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 c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(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,o=function(e,t){if(null==e)return{};var n,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var b=o.a.createContext({}),l=function(e){var t=o.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},d=function(e){var t=l(e.components);return o.a.createElement(b.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},p=o.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,i=e.parentName,b=s(e,["components","mdxType","originalType","parentName"]),d=l(n),p=a,h=d["".concat(i,".").concat(p)]||d[p]||u[p]||r;return n?o.a.createElement(h,c(c({ref:t},b),{},{components:n})):o.a.createElement(h,c({ref:t},b))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,i=new Array(r);i[0]=p;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:a,i[1]=c;for(var b=2;b<r;b++)i[b]=n[b];return o.a.createElement.apply(null,i)}return o.a.createElement.apply(null,n)}p.displayName="MDXCreateElement"}}]);