-
Notifications
You must be signed in to change notification settings - Fork 0
/
420219d2.e4063af4.js
1 lines (1 loc) · 12.7 KB
/
420219d2.e4063af4.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{141:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return o})),a.d(t,"metadata",(function(){return c})),a.d(t,"rightToc",(function(){return l})),a.d(t,"default",(function(){return s}));var n=a(2),i=a(6),r=(a(0),a(250)),o={id:"delphi",title:"Delphi",hide_title:!0,sidebar_label:"Delphi"},c={id:"Instalacao/delphi",isDocsHomePage:!1,title:"Delphi",description:"Delphi",source:"@site/docs\\Instalacao\\Delphi.md",permalink:"/documentation/docs/Instalacao/delphi",sidebar_label:"Delphi",sidebar:"someSidebar",previous:{title:"Ruby",permalink:"/documentation/docs/Instalacao/ruby"},next:{title:"Flutter",permalink:"/documentation/docs/Instalacao/flutter"}},l=[{value:"Pre requirements",id:"pre-requirements",children:[]},{value:"Download the Delphi SDK - API Boletos (Bolix)",id:"download-the-delphi-sdk---api-boletos-bolix",children:[]},{value:"Download the Delphi SDK - Pix",id:"download-the-delphi-sdk---pix",children:[]},{value:"Using the Gerencianet SDK",id:"using-the-gerencianet-sdk",children:[]},{value:"External Project Dependencies",id:"external-project-dependencies",children:[]}],b={rightToc:l};function s(e){var t=e.components,a=Object(i.a)(e,["components"]);return Object(r.b)("wrapper",Object(n.a)({},b,a,{components:t,mdxType:"MDXLayout"}),Object(r.b)("h1",{className:"titulo"},"Delphi"),Object(r.b)("div",{className:"subtitulo"},Object(r.b)("p",null,"Our API is ",Object(r.b)("a",{href:"https://en.wikipedia.org/wiki/Representational_state_transfer"},"RESTful"),"\nand responds in ",Object(r.b)("a",{href:"https://www.json.org/json-en.html"},"JSON"),". Gerencianet uses ",Object(r.b)("a",{href:"https://oauth.net/"},"OAuth")," to provide authorized access to the API. Our NodeJS SDK is already prepared to perform this authentication automatically."),Object(r.b)("p",null,"Below, check out the procedures for installing the Gerencianet SDK in Delphi:"),Object(r.b)("br",null),Object(r.b)("h2",{id:"pre-requirements"},"Pre requirements"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Applications that will use the SDK must be compiled on Windows 32-bit platform."),Object(r.b)("li",{parentName:"ul"},"Desktop applications only.")),Object(r.b)("br",null),Object(r.b)("div",{className:"admonition admonition-info alert alert--info"},Object(r.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"info")),Object(r.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"Originally, Delphi SDK's were run and developed on Delphi Rio Community Edition 10.3."),Object(r.b)("p",{parentName:"div"},"Remembering that this SDK was developed to be backward compatible, that is, compatible with both the latest versions of Delphi and the older versions, however, Gerencianet will only support win-32 desktop applications developed in Delphi Rio Community Edition 10.3."))),Object(r.b)("br",null),Object(r.b)("h2",{id:"download-the-delphi-sdk---api-boletos-bolix"},"Download the Delphi SDK - API Boletos (Bolix)"),Object(r.b)("p",null," All demo code is available in our GitHub repository ",Object(r.b)("a",{href:"https://github.com/gerencianet/gn-api-sdk-delphi",target:"_blank"},"(Click in this link)"),". After completing the download, unzip the file in a folder of your choice and the SDK will be ready to use."),Object(r.b)("br",null),Object(r.b)("h2",{id:"download-the-delphi-sdk---pix"},"Download the Delphi SDK - Pix"),Object(r.b)("p",null," All demo code is available in our GitHub repository ",Object(r.b)("a",{href:"https://github.com/gerencianet/gn-api-sdk-delphi-pix",target:"_blank"},"(Click in this link)"),". After completing the download, unzip the file in a folder of your choice and the SDK will be ready to use."),Object(r.b)("br",null),Object(r.b)("h2",{id:"using-the-gerencianet-sdk"},"Using the Gerencianet SDK"),Object(r.b)("p",null,"To use the SDK, just add the classes to your project and call them according to your needs."),Object(r.b)("br",null),Object(r.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(r.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(r.b)("path",Object(n.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(n.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"Depending on the Endpoint to be used, it will be necessary to add DLL's (Available in: \\Api Compiled) and external classes (Available in: \\Code\\External) to your project as well."))),Object(r.b)("p",null,"The API will always return a JSON string, so any argument type passed to SDK functions must be of type ",Object(r.b)("em",{parentName:"p"},"String"),"."),Object(r.b)("p",null,"Before consuming any API endpoints, you must authenticate to the API using the SDK. For this, you will provide your data:"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("code",null,"Client_Id"),";"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("code",null,"Client_Secret"),";"),Object(r.b)("li",{parentName:"ul"},"Enviroment (sandbox or production);"),Object(r.b)("li",{parentName:"ul"},"Certificate in .p12 mode (Pix API only);")),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"note")),Object(r.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},'The "sandbox" (or "homologation") environment is the place that Gerencianet makes available to the integrator to test its integration.'),Object(r.b)("p",{parentName:"div"},'The "production" environment is the "real" environment that your application should be in to generate "real" charges (or "transactions").'),Object(r.b)("p",{parentName:"div"},Object(r.b)("strong",{parentName:"p"},"REMEMBER:"),' if you activate the "sandbox", use ',Object(r.b)("em",{parentName:"p"},"Client_Id")," and ",Object(r.b)("em",{parentName:"p"},"Client_Secret"),' for "homologation" (',Object(r.b)("a",{href:"http://image.prntscr.com/image/447be4bc64644a35bcf5eaecd1125f5d.png",target:"_blank"},"see where to find"),'), as well as, if you are using "production" environment, use ',Object(r.b)("em",{parentName:"p"},"Client_Id")," and ",Object(r.b)("em",{parentName:"p"},"Client_Secret")," from that environment (",Object(r.b)("a",{href:"http://image.prntscr.com/image/7dc272063bb74dccba91739701a0478b.png",target:"_blank"},"see where to find"),")."),Object(r.b)("p",{parentName:"div"},"If you use our Pix API, upload your certificate (.p12 file). If you don't have a certificate yet, see ",Object(r.b)("a",Object(n.a)({parentName:"p"},{href:"https://gerencianet.com.br/artigo/como-gerar-o-certificado-para-usar-a-api-pix/"}),"how to generate"),"."))),Object(r.b)("br",null),Object(r.b)("h2",{id:"external-project-dependencies"},"External Project Dependencies"),Object(r.b)("p",null,"For SDK development, some external classes available in:"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Classe Super Object: ",Object(r.b)("a",Object(n.a)({parentName:"li"},{href:"https://github.com/onryldz/x-superobject"}),"https://github.com/onryldz/x-superobject")),Object(r.b)("li",{parentName:"ul"},"Classe ZXingQRCode: ",Object(r.b)("a",Object(n.a)({parentName:"li"},{href:"https://github.com/foxitsoftware/DelphiZXingQRCode/tree/master/Source"}),"https://github.com/foxitsoftware/DelphiZXingQRCode/tree/master/Source")),Object(r.b)("li",{parentName:"ul"},"Classe Chilkat: ",Object(r.b)("a",Object(n.a)({parentName:"li"},{href:"https://www.chilkatsoft.com/delphiDll.asp"}),"https://www.chilkatsoft.com/delphiDll.asp"))),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(n.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"})))),"tip")),Object(r.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},'These external classes are already inside our project in the "Utils/External" folder.')))))}s.isMDXComponent=!0},250:function(e,t,a){"use strict";a.d(t,"a",(function(){return p})),a.d(t,"b",(function(){return h}));var n=a(0),i=a.n(n);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function c(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?o(Object(a),!0).forEach((function(t){r(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):o(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function l(e,t){if(null==e)return{};var a,n,i=function(e,t){if(null==e)return{};var a,n,i={},r=Object.keys(e);for(n=0;n<r.length;n++)a=r[n],t.indexOf(a)>=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var b=i.a.createContext({}),s=function(e){var t=i.a.useContext(b),a=t;return e&&(a="function"==typeof e?e(t):c(c({},t),e)),a},p=function(e){var t=s(e.components);return i.a.createElement(b.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},m=i.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,r=e.originalType,o=e.parentName,b=l(e,["components","mdxType","originalType","parentName"]),p=s(a),m=n,h=p["".concat(o,".").concat(m)]||p[m]||d[m]||r;return a?i.a.createElement(h,c(c({ref:t},b),{},{components:a})):i.a.createElement(h,c({ref:t},b))}));function h(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var r=a.length,o=new Array(r);o[0]=m;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:n,o[1]=c;for(var b=2;b<r;b++)o[b]=a[b];return i.a.createElement.apply(null,o)}return i.a.createElement.apply(null,a)}m.displayName="MDXCreateElement"}}]);