-
Notifications
You must be signed in to change notification settings - Fork 0
/
017d23e3.251881f6.js
1 lines (1 loc) · 40.2 KB
/
017d23e3.251881f6.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{250:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return p}));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 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 o(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){c(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 l(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 b=r.a.createContext({}),s=function(e){var t=r.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},u=function(e){var t=s(e.components);return r.a.createElement(b.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},m=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,c=e.originalType,i=e.parentName,b=l(e,["components","mdxType","originalType","parentName"]),u=s(n),m=a,p=u["".concat(i,".").concat(m)]||u[m]||d[m]||c;return n?r.a.createElement(p,o(o({ref:t},b),{},{components:n})):r.a.createElement(p,o({ref:t},b))}));function p(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var c=n.length,i=new Array(c);i[0]=m;var o={};for(var l in t)hasOwnProperty.call(t,l)&&(o[l]=t[l]);o.originalType=e,o.mdxType="string"==typeof e?e:a,i[1]=o;for(var b=2;b<c;b++)i[b]=n[b];return r.a.createElement.apply(null,i)}return r.a.createElement.apply(null,n)}m.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),i=n(254),o=n(92),l=n.n(o);const b=37,s=39;t.a=function(e){const{block:t,children:n,defaultValue:o,values:u,groupId:d}=e,{tabGroupChoices:m,setTabGroupChoices:p}=Object(c.a)(),[O,j]=Object(a.useState)(o);if(null!=d){const e=m[d];null!=e&&e!==O&&u.some(t=>t.value===e)&&j(e)}const h=e=>{j(e),null!=d&&p(d,e)},g=[];return r.a.createElement("div",null,r.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(i.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(i.a)("tabs__item",l.a.tabItem,{"tabs__item--active":O===e}),key:e,ref:e=>g.push(e),onKeyDown:e=>((e,t,n)=>{switch(n.keyCode){case s:((e,t)=>{const n=e.indexOf(t)+1;e[n]?e[n].focus():e[0].focus()})(e,t);break;case b:((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:()=>h(e),onClick:()=>h(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)}},99:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return l})),n.d(t,"metadata",(function(){return b})),n.d(t,"Highlight",(function(){return s})),n.d(t,"rightToc",(function(){return u})),n.d(t,"default",(function(){return m}));var a=n(2),r=n(6),c=(n(0),n(250)),i=n(257),o=n(258),l={id:"CriandoCarne",title:"Criando carn\xeas",hide_title:!0,sidebar_label:"Creating carn\xeas"},b={id:"Carnes/CriandoCarne",isDocsHomePage:!1,title:"Criando carn\xeas",description:"Creating carn\xeas",source:"@site/docs\\Carnes\\CriarCarne.md",permalink:"/documentation/docs/Carnes/CriandoCarne",sidebar_label:"Creating carn\xeas",sidebar:"someSidebar",previous:{title:"Introdu\xe7\xe3o",permalink:"/documentation/docs/Carnes/Introducao"},next:{title:"Outros endpoints",permalink:"/documentation/docs/Carnes/EndpointsCarne"}},s=function(e){var t=e.children;e.color;return Object(c.b)("span",{style:{borderRadius:"2px",color:"#009615",padding:"0.2rem"}},t)},u=[{value:"1. Create Carn\xea",id:"1-create-carn\xea",children:[{value:"a) Hierarchical structure of Schema attributes that can be used:",id:"a-hierarchical-structure-of-schema-attributes-that-can-be-used",children:[]},{value:"b) Attributes that can be used to create a carn\xea:",id:"b-attributes-that-can-be-used-to-create-a-carn\xea",children:[]}]},{value:"2. Other endpoints and methods",id:"2-other-endpoints-and-methods",children:[]},{value:"3. Videos: Carn\xeas",id:"3-videos-carn\xeas",children:[{value:"3.1. Overview of Carn\xeas (Gerencianet API integration)",id:"31-overview-of-carn\xeas-gerencianet-api-integration",children:[]},{value:"3.2. Creating a transaction by issuing a carn\xea (Gerencianet API integration)",id:"32-creating-a-transaction-by-issuing-a-carn\xea-gerencianet-api-integration",children:[]}]},{value:"4. Next steps",id:"4-next-steps",children:[]}],d={Highlight:s,rightToc:u};function m(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},d,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)("h1",{className:"titulo"},"Creating carn\xeas"),Object(c.b)("div",{className:"subtitulo"},Object(c.b)("p",null,"Learn how to generate a carn\xea for your customers. Carn\xea is a payment method that generates a set of transactions (installments) with the same payment and customer information in all of them - it is ideal for those who carry out sales in installments and also for those who work with monthly payments."),Object(c.b)("p",null,"The installments of a carn\xea are due monthly, according to the date defined by the integrator. To generate a carn\xea, you need to provide the following data:"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"Items (or service) offered;"),Object(c.b)("li",{parentName:"ul"},"Due date of the 1st installment;"),Object(c.b)("li",{parentName:"ul"},"Number of installments (repetitions).")),Object(c.b)("p",null,"To create the carn\xea, you must send a ",Object(c.b)("code",null,"POST")," request to the ",Object(c.b)("code",null,"/v1/carnet")," route."),Object(c.b)("p",null,"The rest of this page presents the detailed procedures for creating the carn\xea, but you need to install one of our libraries on your server to run the sample code. ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"../Instalacao/introducao"}),"Make sure the Gerencanet SDK has been installed"),"."),Object(c.b)("p",null,"The following is an example code for creating a carn\xea using the available SDK's. Note that we are already defining the items, customer data, due date of the first installment of the carn\xea and the number of installments (in months): "),Object(c.b)("h2",{id:"1-create-carn\xea"},"1. Create Carn\xea"),Object(c.b)(i.a,{defaultValue:"php",values:[{label:"PHP",value:"php"},{label:"Python",value:"python"},{label:"NodeJS",value:"js"},{label:".NET",value:"c"},{label:"Java",value:"java"},{label:"GO",value:"go"},{label:"Ruby",value:"ruby"},{label:"Delphi",value:"delphi"}],mdxType:"Tabs"},Object(c.b)(o.a,{value:"php",mdxType:"TabItem"},Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),"<?php\n \nrequire __DIR__.'/../../vendor/autoload.php'; // caminho relacionado a SDK\n \nuse Gerencianet\\Exception\\GerencianetException;\nuse Gerencianet\\Gerencianet;\n \n$clientId = 'informe_seu_client_id'; // insira seu Client_Id, conforme o ambiente (Des ou Prod)\n$clientSecret = 'informe_seu_client_secret'; // insira seu Client_Secret, conforme o ambiente (Des ou Prod)\n \n$options = [\n 'client_id' => $clientId,\n 'client_secret' => $clientSecret,\n 'sandbox' => true // altere conforme o ambiente (true = desenvolvimento e false = producao)\n];\n \n$item_1 = [\n 'name' => 'Item 1', // nome do item, produto ou servi\xe7o\n 'amount' => 1, // quantidade\n 'value' => 1000 // valor (1000 = R$ 10,00) (Obs: \xc9 poss\xedvel a cria\xe7\xe3o de itens com valores negativos. Por\xe9m, o valor total da fatura deve ser superior ao valor m\xednimo para gera\xe7\xe3o de transa\xe7\xf5es.)\n]\n \n$item_2 = [\n 'name' => 'Item 2' // nome do item, produto ou servi\xe7o\n 'amount' => 2, // quantidade\n 'value' => 2000 // valor (2000 = R$ 20,00)\n]\n \n$items = [\n $item_1,\n $item_2\n]\n \n$customer = [\n 'name' => 'Gorbadoc Oldbuck', // nome do cliente\n 'cpf' => '94271564656' , // cpf do cliente\n 'phone_number' => '5144916523' // telefone do cliente\n];\n\n// Exemplo para receber notifica\xe7\xf5es da altera\xe7\xe3o do status do carne.\n// $metadata = ['notification_url'=>'sua_url_de_notificacao_.com.br']\n// Outros detalhes em: https://dev.gerencianet.com.br/docs/notificacoes\n\n// Como enviar seu $body com o $metadata\n// $body = [\n// 'items' => $items,\n// 'customer' => $customer,\n// 'expire_at' => '2020-12-02',\n// 'repeats' => 5,\n// 'split_items' => false,\n// 'metadata' => $metadata\n// ];\n\n$body = [\n 'items' => $items,\n 'customer' => $customer,\n 'expire_at' => '2020-12-02', // data de vencimento da primeira parcela do carn\xea\n 'repeats' => 5, // n\xfamero de parcelas do carn\xea\n 'split_items' => false\n];\n\ntry {\n $api = new Gerencianet($options);\n $carnet = $api->createCarnet([], $body);\n \n print_r($carnet);\n} catch (GerencianetException $e) {\n print_r($e->code);\n print_r($e->error);\n print_r($e->errorDescription);\n} catch (Exception $e) {\n print_r($e->getMessage());\n}\n"))),Object(c.b)(o.a,{value:"python",mdxType:"TabItem"},Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-py"}),"from gerencianet import Gerencianet\n \noptions = {\n 'client_id': 'client_id',\n 'client_secret': 'client_secret',\n 'sandbox': True\n}\n \ngn = Gerencianet(options)\n \nbody = {\n 'items': [{\n 'name': 'Carnet Item 1',\n 'value': 1000,\n 'amount': 2\n }],\n 'customer': {\n 'name': 'Gorbadoc Oldbuck',\n 'email': '[email protected]',\n 'cpf': '94271564656',\n 'birth': '1977-01-15',\n 'phone_number': '5144916523'\n },\n 'repeats': 4,\n 'expire_at': '2020-12-12'\n}\n \ngn.create_carnet(body=body)\n"))),Object(c.b)(o.a,{value:"js",mdxType:"TabItem"},Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-js"}),"'use strict';\n \nvar Gerencianet = require('gn-api-sdk-node');\n \nvar clientId = 'your_client_id';\nvar clientSecret = 'your_client_secret';\n \nvar options = {\n client_id: clientId,\n client_secret: clientSecret,\n sandbox: true\n}\n \nvar body = {\n items: [{\n name: 'Carnet Item 1',\n value: 1000,\n amount: 2\n }],\n customer: {\n name: 'Gorbadoc Oldbuck',\n email: '[email protected]',\n cpf: '94271564656',\n birth: '1977-01-15',\n phone_number: '5144916523'\n },\n expire_at: '2020-12-12',\n repeats: 12,\n split_items: false\n}\n \nvar gerencianet = new Gerencianet(options);\n \ngerencianet\n .createCarnet({}, body)\n .then(console.log)\n .catch(console.log)\n .done();\n"))),Object(c.b)(o.a,{value:"c",mdxType:"TabItem"},Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-js"}),'dynamic endpoints = new Endpoints("client_id", "client_secret", true);\n \nvar body = new {\n items = new [] {\n new {\n name = "Carnet Item 1",\n value = 1000,\n amount = 2\n }\n },\n customer = new {\n name = "Gorbadoc Oldbuck",\n email = "[email protected]",\n cpf = "94271564656",\n birth = "1977-01-15",\n phone_number = "5144916523"\n },\n repeats = 4,\n expire_at = "2020-12-12",\n metadata = new {\n custom_id = "my_id",\n notification_url = "http://yourdomain.com"\n }\n};\n \nvar response = endpoints.CreateCarnet(null, body);\n'))),Object(c.b)(o.a,{value:"java",mdxType:"TabItem"},Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-java"}),'/* Para que a SDK Java funcione corretamente, \xe9 necess\xe1rio que a instancia\xe7\xe3o do m\xf3dulo seja feita atrav\xe9s da cria\xe7\xe3o de um objeto do tipo Gerencianet.\n\nSempre que quisermos chamar uma fun\xe7\xe3o da API, basta invocar o m\xe9todo call do objeto Gerencianet, passando como par\xe2metro o nome do m\xe9todo, os par\xe2metros da requisi\xe7\xe3o (sempre ser\xe1 um HashMap<String, String>), e o "body", que consiste nas propriedades a serem passadas como argumento na chamada de um fun\xe7\xe3o da SDK. O "body" pode ser declarado de duas formas: um JSONObject ou um Map<String, Object>.\n\nEsta estrutura \xe9 necess\xe1ria para representar o corpo da requisi\xe7\xe3o http que \xe9 enviada \xe0 um determinado endpoint. Se o "body" for um JSONObject, o retorno do m\xe9todo call ser\xe1 um JSONObject, se for um Map<String, Object>, o retorno do m\xe9todo call ser\xe1 um Map<String, Object>\n\nA seguir, disponibilizamos links de nosso Github mostrando duas formas diferentes de retorno: JSONObject\ne Map<String, Object>\n\n\nJSONObject\n\nhttps://github.com/gerencianet/gn-api-sdk-java-examples/blob/master/src/main/java/br/com/gerencianet/carnet/json/Create.java\n\n\nMap<String, Object>\n\nhttps://github.com/gerencianet/gn-api-sdk-java-examples/blob/master/src/main/java/br/com/gerencianet/carnet/map/Create.java\n\n*/\n'))),Object(c.b)(o.a,{value:"go",mdxType:"TabItem"},Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-go"}),'// No c\xf3digo de exemplo de uso da SDK de Go, definimos as credenciais de acesso \xe0 API (Client_Id e Client_Secret) e o ambiente a ser usado (sandbox como \'true\' ou \'false\') dentro de um arquivo espec\xedfico (configs.go), que est\xe1 localizado no diret\xf3rio "_examples/configs". Essas credenciais s\xe3o exportadas atrav\xe9s da vari\xe1vel \'Credentials\'.\n\npackage main\n\nimport (\n "fmt"\n "github.com/gerencianet/gn-api-sdk-go/gerencianet"\n "github.com/gerencianet/gn-api-sdk-go/_examples/configs"\n)\n\nfunc main(){\n \n credentials := configs.Credentials\n gn := gerencianet.NewGerencianet(credentials)\n\n customer := map[string]interface{}{\n "name": "Gorbadoc Oldbuck",\n "cpf": "04267484171",\n "phone_number": "5144916523",\n }\n\n items := []map[string]interface{}{\n {\n "name": "Item 1",\n "value": 1000,\n "amount": 1,\n },\n {\n "name": "Item 2",\n "value": 2000,\n "amount": 2,\n },\n }\n\n body := map[string]interface{} {\n "items": items,\n "customer": customer,\n "expire_at": "2020-12-02",\n "repeats": 5,\n "split_items": false,\n }\n\n res, err := gn.CreateCarnet(body)\n\n if err != nil {\n fmt.Println(err)\n } else {\n fmt.Println(res)\n }\n}\n'))),Object(c.b)(o.a,{value:"ruby",mdxType:"TabItem"},Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-js"}),'require "gerencianet"\nrequire "date"\n \noptions = {\n client_id: "client_id",\n client_secret: "client_secret",\n sandbox: true\n}\n \ntomorrow = Date.today + 1\n \nbody = {\n expire_at: tomorrow.strftime,\n items: [{\n name: "Carnet Item 1",\n value: 1000,\n amount: 2\n }],\n customer: {\n name: "Gorbadoc Oldbuck",\n email: "[email protected]",\n cpf: "94271564656",\n birth: "1977-01-15",\n phone_number: "5144916523"\n },\n repeats: 12,\n split_items: false\n}\n \ngerencianet = Gerencianet.new(options)\ngerencianet.create_carnet(body: body)\n'))),Object(c.b)(o.a,{value:"delphi",mdxType:"TabItem"},Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),"interface\nfunction CarnetCreate: String;\n\nimplementation\nuses uGerenciaClient, uGerenciaNetClientUtilities;\n{... your code ... }\n\nfunction CarnetCreate: String;\nconst\n Body_Customer_Address = \n '\"street\": \"Via Monte di Dio\",'+\n '\"number\": 66,'+\n '\"neighborhood\": \"Sao Paulo\",'+\n '\"complement\": \"\",'+\n '\"city\": \"Naples\",'+\n '\"state\": \"SP\",'+\n '\"zipcode\": \"35400000\"';\n\n Body_Customer_Before_Address = \n '\"email\": \"[email protected]\",'+\n '\"phone_number\": \"94271564656\",'+\n '\"birth\": \"1977-07-17\",';\n\n Body_Customer_After_Address = \n '\"name\": \"Gorbadoc Oldbuck\", \"cpf\": \"94271564656\"';\n\n Body_Customer = \n '\"customer\": { '+Body_Customer_Before_Address + \n '\"address\": { '+ Body_Customer_Address + ' }, '\n +Body_Customer_After_Address + ' }, ';\n\n Body_After_Customer_Line1 = \n '\"expire_at\": \"2017-07-10\",'+\n '\"repeats\": 4, \"split_items\": false,';\n\n Body_Items = \n '\"items\": ['+ \n '{'+ \n '\"name\": \"Item 1\",'+\n '\"value\": 1900,'+\n '\"amount\": 2'+\n '},'+\n '{'+\n '\"name\": \"Item 2\",'+\n '\"value\": 3000,'+\n '\"amount\": 1'+ \n '}'+\n ']';\n\n Body = '{ '+Body_Customer + Body_After_Customer_Line1 + Body_Instructions + Body_Items + ' }';\n\nbegin\n EnableService( 'GerenciaNet.dll' ); \n ConfigureService( ToPAnsiChar( 'client_id' ),ToPAnsiChar( 'client_secret' ),'sandbox','config.json',''); \n GerenciaNetAuthorize(); \n\n Result := ExecuteGerenciaNetRequest( 'createCarnet','','',Body );\nend;\n")))),Object(c.b)("br",null),Object(c.b)("br",null),Object(c.b)("h3",{id:"a-hierarchical-structure-of-schema-attributes-that-can-be-used"},"a) Hierarchical structure of Schema attributes that can be used:"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{}),'"id": "/Carnet"\n "items"\n "name"\n "value"\n "amount"\n "customer"\n "name"\n "cpf"\n "email"\n "phone_number"\n "birth"\n "address"\n "street"\n "number"\n "neighborhood"\n "zipcode"\n "city"\n "complement"\n "state"\n "juridical_person"\n "corporate_name"\n "cnpj"\n "expire_at"\n "repeats"\n "split_items"\n "metadata"\n "custom_id"\n "notification_url"\n "configurations"\n "fine"\n "interest"\n "message"\n "discount"\n "type"\n "percentage",\n "currency"\n "value"\n "conditional_discount"\n "type"\n "percentage",\n "currency"\n "value"\n "until_date"\n')),Object(c.b)("p",null,"To more details, ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"../AmbienteTestes/PlaygroundCarne"}),"click here")," and explore our Playground."),Object(c.b)("br",null),Object(c.b)("h3",{id:"b-attributes-that-can-be-used-to-create-a-carn\xea"},"b) Attributes that can be used to create a carn\xea:"),Object(c.b)("table",null,Object(c.b)("tbody",null,Object(c.b)("tr",null,Object(c.b)("th",null,"Attribute"),Object(c.b)("th",{align:"center"},"Description"),Object(c.b)("th",{align:"center"},"Required"),Object(c.b)("th",{align:"center"},"Type")),Object(c.b)("tr",null,Object(c.b)("td",null,Object(c.b)("code",null,"items")),Object(c.b)("td",{align:"left"},"item being sold. The same transaction can have unlimited items. ",Object(c.b)("br",null),Object(c.b)("br",null)," ",Object(c.b)("em",null,"Item attributes:"),Object(c.b)("br",null),Object(c.b)("code",null,"name*"),"// Name of the item, product or service. ",Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"Minimum 1 character and maximum 255 characters (String)."),Object(c.b)("br",null),Object(c.b)("br",null)," ",Object(c.b)("code",null,"value*"),"// Value, in cents of Real. Ex: BRL 10.00 = 1000. ",Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"Integer"),Object(c.b)("br",null),Object(c.b)("br",null)," ",Object(c.b)("code",null,"amount")," ",Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"Integer")),Object(c.b)("td",{align:"center"},"Yes"),Object(c.b)("td",{align:"center"},"Array")),Object(c.b)("tr",null,Object(c.b)("td",null,Object(c.b)("code",null,"customer")),Object(c.b)("td",{align:"left"},"Payer's personal data.",Object(c.b)("br",null),Object(c.b)("br",null)," ",Object(c.b)("em",null,"Customer attributes:"),Object(c.b)("br",null),Object(c.b)("code",null,"name*")," ",Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"( String)"),Object(c.b)("br",null),Object(c.b)("br",null)," ",Object(c.b)("code",null,"cpf*")," // Customer CPF (no dots, commas or hyphens).",Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"(String)"),Object(c.b)("br",null),Object(c.b)("br",null)," ",Object(c.b)("code",null,"email*")," // Valid customer email address. ",Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"(String)"),Object(c.b)("br",null),Object(c.b)("br",null),Object(c.b)("code",null,"phone_number*")," // Valid customer phone number, no special characters. ",Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"(String)"),Object(c.b)("br",null),Object(c.b)("br",null),Object(c.b)("code",null,"birth")," // Customer's date of birth (valid date in YYYY-MM-DD format) . ",Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"(String)"),Object(c.b)("br",null),Object(c.b)("br",null),Object(c.b)("code",null,"address")," // Shipping Address. ",Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"(Object)")," (more info)",Object(c.b)("br",null),Object(c.b)("br",null),Object(c.b)("code",null,"juridical_person")," // Juridical Person data. ",Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"(Object)")," (more info)"),Object(c.b)("td",{align:"center"},"Yes"),Object(c.b)("td",{align:"center"},"Object")),Object(c.b)("tr",null,Object(c.b)("td",null,Object(c.b)("code",null,"expire_at")),Object(c.b)("td",{align:"left"},"Payment expiration date. The interval of the installments of a carn\xea is always 1 (one) month between them.",Object(c.b)("br",null),Object(c.b)("code",null,"Format: YYYY-MM-DD")),Object(c.b)("td",{align:"center"},"Yes"),Object(c.b)("td",{align:"center"},"String")),Object(c.b)("tr",null,Object(c.b)("td",null,Object(c.b)("code",null,"repeats")),Object(c.b)("td",{align:"left"},"Number of installments in the carn\xea.",Object(c.b)("br",null),Object(c.b)("code",null,"Minimum of 2 installments and maximum of 12 installments ")),Object(c.b)("td",{align:"center"},"Yes"),Object(c.b)("td",{align:"center"},"Integer")),Object(c.b)("tr",null,Object(c.b)("td",null,Object(c.b)("code",null,"split_items")),Object(c.b)("td",{align:"left"},"Split items between parcels. Defines if the carn\xea items will be divided between the installments (true), or if the value of each installment will be the total value of the items (false)."),Object(c.b)("td",{align:"center"},"No"),Object(c.b)("td",{align:"center"},"Boolean")),Object(c.b)("tr",null,Object(c.b)("td",null,Object(c.b)("code",null,"metadata")),Object(c.b)("td",{align:"left"},"Defines transaction specific data",Object(c.b)("br",null),Object(c.b)("br",null)," ",Object(c.b)("em",null,"Metadata attributes:"),Object(c.b)("br",null),Object(c.b)("code",null,"custom_id"),"// Allows you to associate a Gerencianet transaction with a specific ID on your system or application, allowing you to identify it if you have a specific identification and want to keep it. ",Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"Maximum 255 characters. String/null."),Object(c.b)("br",null),Object(c.b)("br",null)," ",Object(c.b)("code",null,"notification_url"),"// Address of your valid URL that will receive transaction status change notifications. ",Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"Maximum 255 characters. String/null.")),Object(c.b)("td",{align:"center"},"No"),Object(c.b)("td",{align:"center"},"Object")),Object(c.b)("tr",null,Object(c.b)("td",null,Object(c.b)("code",null,"configurations")),Object(c.b)("td",{align:"left"},"Allows you to include a fine and interest in the carn\xea if it is paid after the due date.",Object(c.b)("br",null),Object(c.b)("br",null)," ",Object(c.b)("em",null,"Configuration attributes:"),Object(c.b)("br",null),Object(c.b)("br",null),Object(c.b)(s,{color:"#009615",mdxType:"Highlight"}," fine"),"// Amount charged for fine after expiration. For example: if you want 2%, you would enter ",Object(c.b)("code",null,"200"),".",Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"Minimum of 0 and maximum of 1000. Integer."),Object(c.b)("br",null),Object(c.b)("br",null),Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"If you have fine settings enabled in Gerencianet and want to generate API emissions without fines, use ",Object(c.b)("code",null,"0")," as the value of the ",Object(c.b)("code",null,"fine")," attribute "),Object(c.b)("br",null),Object(c.b)("br",null),Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"interest"),"// Amount charged for interest per day after the due date. For example: if you want 0.033%, you would enter ",Object(c.b)("code",null,"33"),".",Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"Minimum of 0 and maximum of 330. Integer."),Object(c.b)("br",null),Object(c.b)("br",null),Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"If you have fine settings activated in your Gerencianet and want to generate interest-free API issues, use ",Object(c.b)("code",null,"0")," as the attribute value ",Object(c.b)("code",null,"interest"))),Object(c.b)("td",{align:"center"},"No"),Object(c.b)("td",{align:"center"},"Object")),Object(c.b)("tr",null,Object(c.b)("td",null,Object(c.b)("code",null,"message")),Object(c.b)("td",{align:"left"},'Allows you to include an "observation" in the billing, or in other words, a message to the customer. This message can be seen in e-mails related to billing, on the boleto or carn\xea.',Object(c.b)("br",null),Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"Up to 4 lines containing 100 characters in each line. String. ",Object(c.b)("br",null),"The ",Object(c.b)("code",null,"\\n")," operator is used to perform the line break.")),Object(c.b)("td",{align:"center"},"No"),Object(c.b)("td",{align:"center"},"String")),Object(c.b)("tr",null,Object(c.b)("td",null,Object(c.b)("code",null,"discount")),Object(c.b)("td",{align:"left"},"Defines discount data about the charge.",Object(c.b)("br",null),Object(c.b)("br",null)," ",Object(c.b)("em",null,"Discount attributes:"),Object(c.b)("br",null),Object(c.b)("br",null),Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"type*")," // Type of discount (String). Allowed values: ",Object(c.b)("br",null),Object(c.b)("code",null,"currency"),": the discount will be reported in cents. ",Object(c.b)("code",null,"percentage"),": the discount will be informed in percentage.",Object(c.b)("br",null),Object(c.b)("br",null)," ",Object(c.b)("code",null,"cnpj*"),"// CNPJ of the company. ",Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"Size: 14 characters. String."),Object(c.b)("br",null),Object(c.b)("br",null),Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"value*"),"// Discount value (Integer). If the discount type is ",Object(c.b)("code",null,"currency")," , the value of this tag must be informed by the integrator in cents (500 is equivalent to R$ 5.00). If the discount type is ",Object(c.b)("code",null,"percentage"),", the value must be multiplied by 100 ( 1500 is equivalent to 15%). Examples: ",Object(c.b)("br",null),"1)",Object(c.b)("code",null,"currency"),"// must be informed in cents, that is, if the discount will be R$ 5.99, the integrator must inform ",Object(c.b)("code",null,"599")," ;",Object(c.b)("br",null)," 2)",Object(c.b)("code",null,"percentage")," // must be informed in cents, that is, if the discount is 15%, the integrator must inform ",Object(c.b)("code",null,"1500"),".",Object(c.b)("br",null),Object(c.b)("br",null)),Object(c.b)("td",{align:"center"},"No"),Object(c.b)("td",{align:"center"},"Object")),Object(c.b)("tr",null,Object(c.b)("td",null,Object(c.b)("code",null,"conditional_discount")),Object(c.b)("td",{align:"left"},"Defines conditional discount that is valid until a specific date. If payment is not made by that date, the discount is invalidated.",Object(c.b)("br",null),Object(c.b)("br",null)," ",Object(c.b)("em",null,"Attributes of conditional_discount:"),Object(c.b)("br",null),Object(c.b)("br",null),Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"type*"),"// Discount type (String). Allowed values: ",Object(c.b)("br",null),Object(c.b)("code",null,"currency"),": the discount will be reported in cents. ",Object(c.b)("code",null,"percentage"),": the discount will be informed in percentage.",Object(c.b)("br",null),Object(c.b)("br",null)," ",Object(c.b)("code",null,"cnpj*"),"// CNPJ of the company. ",Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"Size: 14 characters. String."),Object(c.b)("br",null),Object(c.b)("br",null),Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"value*"),"// Discount value (Integer). If the discount type is ",Object(c.b)("code",null,"currency")," , the value of this tag must be informed by the integrator in cents ( 500 is equivalent to R$ 5.00). If the discount type is ",Object(c.b)("code",null,"percentage"),", the value must be multiplied by 100 ( 1500 is equivalent to 15%). Examples: ",Object(c.b)("br",null),"1)",Object(c.b)("code",null,"currency"),"// must be informed in cents, that is, if the discount will be R$ 5.99, the integrator must inform ",Object(c.b)("code",null,"599")," ;",Object(c.b)("br",null)," 2)",Object(c.b)("code",null,"percentage")," // must be informed in cents, that is, if the discount is 15%, the integrator must inform ",Object(c.b)("code",null,"1500"),".",Object(c.b)("br",null),Object(c.b)("br",null),Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"until_date*"),", // Maximum date the discount will be granted. (String).",Object(c.b)("br",null),Object(c.b)(s,{color:"#009615",mdxType:"Highlight"},"Format: YYYY-MM-DD")),Object(c.b)("td",{align:"center"},"No"),Object(c.b)("td",{align:"center"},"Object")))),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"Fields with * represent mandatory values")," "),Object(c.b)("br",null),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.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"})))),"payment made as Juridical Person (PJ)")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"The customer associated with the transaction can be a Juridical Person. In this case, the Corporate Name and CNPJ of the paying company must be informed within the attribute ",Object(c.b)("code",null,"juridical_person"),"."),Object(c.b)("a",{href:"../OutrosRecursos/PessoaJuridica",target:"_blank",title:"Link Interno"},"See details at this link")," on how to generate a carn\xea for a client who is a Juridical Person (PJ). ")),Object(c.b)("br",null),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.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"})))),"List of all possible status of a carn\xea and installments")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},'All carn\xeas have status, which represents the "situation" of that carn\xea. Therefore, it is important to know the possible statuses in the API to provide the proper handling in your system.'),Object(c.b)("p",{parentName:"div"},"Check ",Object(c.b)("a",{href:"../VisaoGeral/statusTransacoes",target:"_blank",title:"Link Interno"},"in this link")," for all the details of the possible status of carnets and installments. "))),Object(c.b)("br",null),Object(c.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(c.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"})))),"Callbacks (notifications) of the installments and carn\xeas from the API to your system")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"Notifications allow you to be informed when a parcel or a carn\xea has its status changed. In this way, you will be able to identify when an installment is paid, for example."),Object(c.b)("p",{parentName:"div"},"Check this link for all the details on how to implement your notification URL."))),Object(c.b)("br",null),Object(c.b)("br",null),Object(c.b)("hr",null),Object(c.b)("h2",{id:"2-other-endpoints-and-methods"},"2. Other endpoints and methods"),Object(c.b)("p",null,"There are other carn\xea's endpoints and methods that are available in the API and can be exploited by the integrator. Check out the complete list:"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"../Carnes/EndpointsCarne#1-retornar-informa%C3%A7%C3%B5es-sobre-um-carn%C3%AA"}),"Return carn\xea's info"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"../Carnes/EndpointsCarne#2-alterar-url-de-notifica%C3%A7%C3%A3o-notification_url-eou-custom_id-de-carn%C3%AAs"}),"Change carn\xea's URL notification (notification_url) and/or custom_id"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"../Carnes/EndpointsCarne#3-alterar-data-de-vencimento-de-parcela-do-carn%C3%AA"}),"Change carn\xea's due date"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"../Carnes/EndpointsCarne#4-cancelar-um-carn%C3%AA"}),"Cancel a carn\xea"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"../Carnes/EndpointsCarne#5-cancelar-parcela-espec%C3%ADfica-de-carn%C3%AA"}),"Cancel a carn\xea's specific installments"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"../Carnes/EndpointsCarne#6-reenviar-carn%C3%AA-por-e-mail"}),"Resend carn\xea by e-mail"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"../Carnes/EndpointsCarne#7-reenviar-parcela-espec%C3%ADfica-de-carn%C3%AA-por-e-mail"}),"Resend a carn\xea's specific installment by e-mail"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"../Carnes/EndpointsCarne#8-acrescentar-informa%C3%A7%C3%B5es-ao-hist%C3%B3rico-do-carn%C3%AA"}),"Add information to carn\xea's history "))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"../Carnes/EndpointsCarne#9-marcar-como-pago-determinada-parcela-de-carn%C3%AA"}),"Mark as paid a certain installment a carn\xea")," "))),Object(c.b)("br",null),Object(c.b)("hr",null),Object(c.b)("h2",{id:"3-videos-carn\xeas"},"3. Videos: Carn\xeas"),Object(c.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 create a carn\xea through integration with our API. "),Object(c.b)("br",null),Object(c.b)("h3",{id:"31-overview-of-carn\xeas-gerencianet-api-integration"},"3.1. Overview of Carn\xeas (Gerencianet API integration)"),Object(c.b)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/eL-A8sqyqvY",frameborder:"0",allowfullscreen:!0}),Object(c.b)("br",null),Object(c.b)("br",null),Object(c.b)("h3",{id:"32-creating-a-transaction-by-issuing-a-carn\xea-gerencianet-api-integration"},"3.2. Creating a transaction by issuing a carn\xea (Gerencianet API integration)"),Object(c.b)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/Zy2EgwOotDg",frameborder:"0",allowfullscreen:!0}),Object(c.b)("br",null),Object(c.b)("br",null),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.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"})))),"Complete Course on Integration with the Gerencianet API ")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"For access to other classes, on other subjects, access the page ",Object(c.b)("a",{href:"../CursosIntegracao/CursoOnline",title:"Link Interno"},"Online Integration Course"),"."))),Object(c.b)("br",null),Object(c.b)("hr",null),Object(c.b)("h2",{id:"4-next-steps"},"4. Next steps"),Object(c.b)("p",null,"With the carn\xeas created, let's see how they work. Be sure to also check out all the ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"OutrosEndpoints.md"}),"carn\xeas related endpoints"),".")))}m.isMDXComponent=!0}}]);