-
Notifications
You must be signed in to change notification settings - Fork 0
/
7055c617.d61adf22.js
1 lines (1 loc) · 67 KB
/
7055c617.d61adf22.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[70],{170:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return l})),t.d(n,"metadata",(function(){return b})),t.d(n,"Highlight",(function(){return s})),t.d(n,"rightToc",(function(){return u})),t.d(n,"default",(function(){return p}));var a=t(2),c=t(6),r=(t(0),t(250)),i=t(257),o=t(258),l={id:"DividindoRecebimentos",title:"Dividindo recebimentos",hide_title:!0,sidebar_label:"Splitting receipts"},b={id:"Marketplace/DividindoRecebimentos",isDocsHomePage:!1,title:"Dividindo recebimentos",description:"Splitting receipts",source:"@site/docs\\Marketplace\\DividindoRecebimentos.md",permalink:"/documentation/docs/Marketplace/DividindoRecebimentos",sidebar_label:"Splitting receipts",sidebar:"someSidebar",previous:{title:"Como funciona",permalink:"/documentation/docs/Marketplace/ComoFunciona"},next:{title:"Lightbox",permalink:"/documentation/docs/Lightbox/lightbox"}},s=function(e){var n=e.children;e.color;return Object(r.b)("span",{style:{borderRadius:"2px",color:"#009615",padding:"0.2rem"}},n)},u=[{value:"1. Creating a Marketplace transaction in <em>One Step</em>",id:"1-creating-a-marketplace-transaction-in-one-step",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 title:",id:"b-attributes-that-can-be-used-to-create-a-title",children:[]}]},{value:"2. Creating a Marketplace transaction in Two Steps",id:"2-creating-a-marketplace-transaction-in-two-steps",children:[{value:"2.1 Creating a Marketplace transaction",id:"21-creating-a-marketplace-transaction",children:[]},{value:"a) Hierarchical structure of Schema attributes that can be used:",id:"a-hierarchical-structure-of-schema-attributes-that-can-be-used-1",children:[]},{value:"b)Attributes that can be used to create a transaction:",id:"battributes-that-can-be-used-to-create-a-transaction",children:[]},{value:"2.2. Associate with the payment method via boleto or card",id:"22-associate-with-the-payment-method-via-boleto-or-card",children:[]}]},{value:"3. Videos: Marketplace",id:"3-videos-marketplace",children:[{value:"3.1.Overview - Getting to Know the Marketplace (Gerencianet API integration)",id:"31overview---getting-to-know-the-marketplace-gerencianet-api-integration",children:[]},{value:"3.2. Creating transaction via Marketplace (Gerencianet API integration)",id:"32-creating-transaction-via-marketplace-gerencianet-api-integration",children:[]}]},{value:"4. Next steps",id:"4-next-steps",children:[]}],d={Highlight:s,rightToc:u};function p(e){var n=e.components,t=Object(c.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},d,t,{components:n,mdxType:"MDXLayout"}),Object(r.b)("h1",{className:"titulo"},"Splitting receipts"),Object(r.b)("div",{className:"subtitulo"},Object(r.b)("p",null,"The marketplace is a tool that allows the division of an amount received between one or more people, according to the percentage defined at the time of creation of the charge."),Object(r.b)("p",null,'When generating a transaction, it is possible to define the division of the amount between several Gerencianet accounts. We use the term "Marketplace Transaction" whenever the payment of a transaction implies partial or full transfers to other Gerencianet accounts. To issue, it is very simple and we provide two ways to carry out the issue: '),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},Object(r.b)("p",{parentName:"li"},Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"#1-cria%C3%A7%C3%A3o-de-transa%C3%A7%C3%A3o-marketplace-em-one-step-um-passo"}),"Creating a Marketplace transaction in ",Object(r.b)("em",{parentName:"a"},"One Step")),", where the title is created in a single step. ")),Object(r.b)("li",{parentName:"ol"},Object(r.b)("p",{parentName:"li"},Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"#2-cria%C3%A7%C3%A3o-de-transa%C3%A7%C3%A3o-marketplace-em-two-steps-dois-passos"}),"Creating a Marketplace transaction in ",Object(r.b)("em",{parentName:"a"},"Two Steps")),", where the title is first created and then the payer and payment method are assigned. "))),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},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:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.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"})))),"Bolix")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"If you have activated Bolix in your Gestornet account, the charges generated by our module/plugin will already come with the pix on the ticket.\nMore details about Bolix and how to activate it, click ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"../Bolix/bolix"}),"here"),"."))),Object(r.b)("h2",{id:"1-creating-a-marketplace-transaction-in-one-step"},"1. Creating a Marketplace transaction in ",Object(r.b)("em",{parentName:"h2"},"One Step")),Object(r.b)("p",null,"In this option, it is necessary that the ",Object(r.b)("em",{parentName:"p"},"body")," of the request contains all the minimum attributes required for issuing the title.\nBelow are implementation examples using the available SDK's:"),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},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:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.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"})))),"Important")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"For the creation of transactions via ",Object(r.b)("em",{parentName:"p"},"One Step")," to occur, it is normally necessary to update your SDK. All the files necessary for this are available through our ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://github.com/gerencianet"}),"repository")," and in our ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"../Instalacao/introducao"}),"documentation"),"."))),Object(r.b)("br",null),Object(r.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(r.b)(o.a,{value:"php",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),"<?php\n\nrequire __DIR__.'/../../autoload.php';\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 $repass_1 = [\n 'payee_code' => \"Insira_aqui_o_indentificador_da_conta_destino\", // identificador da conta Gerencianet (repasse 1)\n 'percentage' => 2500 // porcentagem de repasse (2500 = 25%)\n ];\n \n $repass_2 = [\n 'payee_code' => \"Insira_aqui_o_indentificador_da_conta_destino\", // identificador da conta Gerencianet (repasse 2)\n 'percentage' => 1500 // porcentagem de repasse (1500 = 15%)\n ];\n \n $repasses = [\n $repass_1,\n $repass_2\n ];\n\n $item_1 = [\n 'name' => 'Item 1', // nome do item, produto ou servi\xe7o\n 'amount' => 1, // quantidade\n 'value' => 1500, // 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 'marketplace'=>array('repasses'=>$repasses)\n ];\n $items = [\n $item_1\n ];\n $metadata = array('notification_url'=>'sua_url_de_notificacao_.com.br'); //Url de notifica\xe7\xf5es\n $customer = [\n 'name' => 'Gorbadoc Oldbuck', // nome do cliente\n 'cpf' => '94271564656', // cpf v\xe1lido do cliente\n 'phone_number' => '5144916523', // telefone do cliente\n ];\n $discount = [ // configura\xe7\xe3o de descontos\n 'type' => 'currency', // tipo de desconto a ser aplicado\n 'value' => 599 // valor de desconto \n ];\n $configurations = [ // configura\xe7\xf5es de juros e mora\n 'fine' => 200, // porcentagem de multa\n 'interest' => 33 // porcentagem de juros\n ];\n $conditional_discount = [ // configura\xe7\xf5es de desconto condicional\n 'type' => 'percentage', // sele\xe7\xe3o do tipo de desconto \n 'value' => 500, // porcentagem de desconto\n 'until_date' => '2022-09-13' // data m\xe1xima para aplica\xe7\xe3o do desconto\n ];\n $bankingBillet = [\n 'expire_at' => '2022-09-13', // data de vencimento do titulo\n 'message' => 'teste\\nteste\\nteste\\nteste', // mensagem a ser exibida no boleto\n 'customer' => $customer,\n 'discount' =>$discount,\n 'conditional_discount' => $conditional_discount\n ];\n $payment = [\n 'banking_billet' => $bankingBillet // forma de pagamento (banking_billet = boleto)\n ];\n $body = [\n 'items' => $items,\n 'metadata' =>$metadata,\n 'payment' => $payment\n ];\n try {\n $api = new Gerencianet($options);\n $pay_charge = $api->oneStep([],$body);\n echo '<pre>';\n print_r($pay_charge);\n echo '<pre>';\n \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(r.b)(o.a,{value:"python",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-py"}),"# encoding: utf-8\n\nfrom gerencianet import Gerencianet\nfrom credentials import CREDENTIALS\n\ngn = Gerencianet(CREDENTIALS)\n\nbody = {\n 'items': [{\n 'name': \"Product 1\",\n 'value': 1000,\n 'amount': 2,\n 'marketplace': {\n 'repasses': [{\n 'payee_code': \"informe_payee_code_conta\",\n 'percentage': 2500\n },{\n 'payee_code': \"informe_payee_code_conta\",\n 'percentage': 1500\n }]\n }\n }],\n 'shippings': [{\n 'name': \"Default Shipping Cost\",\n 'value': 100\n }],\n 'payment': {\n 'banking_billet': {\n 'expire_at': '2022-12-12',\n 'customer': {\n 'name': \"Gorbadoc Oldbuck\",\n 'email': \"[email protected]\",\n 'cpf': \"94271564656\",\n 'birth': \"1977-01-15\",\n 'phone_number': \"5144916523\"\n }\n }\n }\n}\n\nresponse = gn.create_charge_onestep(params=None, body=body)\nprint(response)\n"))),Object(r.b)(o.a,{value:"js",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-js"}),"'use strict';\n\nvar Gerencianet = require('gn-api-sdk-node');\nvar credentials = require('./credentials');\n\nvar options = {\n client_id: credentials.client_id,\n client_secret: credentials.client_secret,\n sandbox: true\n}\n\nvar body = {\n\n payment: {\n banking_billet: {\n expire_at: '2022-09-19',\n customer: {\n name: 'Gorbadoc Oldbuck',\n email: '[email protected]',\n cpf: '04267484171',\n birth: '1977-01-15',\n phone_number: '5144916523'\n }\n }\n },\n\n items: [{\n name: 'Product 1',\n value: 500,\n amount: 1,\n marketplace: {\n repasses: [{\n payee_code: \"informe_payee_code_conta\",\n percentage: 2500\n }, {\n payee_code: \"informe_payee_code_conta\",\n percentage: 1500\n }]\n }\n }],\n shippings: [{\n name: 'Default Shipping Cost',\n value: 100\n }]\n}\n\nvar gerencianet = new Gerencianet(options);\n\ngerencianet\n .oneStep([], body)\n .then(console.log)\n .catch(console.log)\n .done();\n"))),Object(r.b)(o.a,{value:"c",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-js"}),'using System;\n\nnamespace Gerencianet.SDK.Examples\n{\n class OneStepBillet\n {\n public static void Execute()\n {\n dynamic endpoints = new Endpoints(Credentials.Default.ClientId, Credentials.Default.ClientSecret, Credentials.Default.Sandbox);\n\n var body = new\n {\n items = new[] {\n new {\n name = "Product 1",\n value = 590,\n amount = 2,\n marketplace = new {\n repasses = new [] { new {\n payee_code = "Insira_aqui_o_indentificador_da_conta_destino",\n percentage = 2500\n },\n new {\n payee_code = "Insira_aqui_o_indentificador_da_conta_destino",\n percentage = 1500\n }\n }\n }\n }\n },\n shippings = new[] {\n new {\n name = "Default Shipping Cost",\n value = 10\n }\n },\n payment = new\n {\n banking_billet = new\n {\n expire_at = "2022-09-15",\n customer = new\n {\n name = "Gorbadoc Oldbuck",\n cpf = "04267484171",\n phone_number = "5144916523"\n }\n }\n }\n };\n\n try\n {\n var response = endpoints.OneStep(null, body);\n Console.WriteLine(response);\n }\n catch (GnException e)\n {\n Console.WriteLine(e.ErrorType);\n Console.WriteLine(e.Message);\n }\n }\n }\n}\n'))),Object(r.b)(o.a,{value:"java",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-java"}),'package br.com.gerencianet.charge.json;\n\nimport java.util.HashMap;\n\nimport org.json.JSONArray;\nimport org.json.JSONObject;\n\nimport br.com.gerencianet.Credentials;\nimport br.com.gerencianet.gnsdk.Gerencianet;\nimport br.com.gerencianet.gnsdk.exceptions.GerencianetException;\n\npublic class OneStepMarketPlace {\n public static void main(String[] args) {\n /* ********* Set credentials parameters ******** */\n Credentials credentials = new Credentials();\n JSONObject options = new JSONObject();\n options.put("client_id", credentials.getClientId());\n options.put("client_secret", credentials.getClientSecret());\n //options.put("partner_token", credentials.getPartnerToken());\n options.put("sandbox", credentials.isSandbox());\n /* ************************************************* */ \n \n // repasses\n \n JSONObject repass_1 = new JSONObject();\n repass_1.put("payee_code", "Insira_aqui_o_indentificador_da_conta_destino");\n repass_1.put("percentage", 1500);\n \n JSONObject repass_2 = new JSONObject();\n repass_2.put("payee_code", "Insira_aqui_o_indentificador_da_conta_destino");\n repass_2.put("percentage", 2500);\n\n JSONArray repass = new JSONArray();\n repass.put(repass_1);\n repass.put(repass_2);\n \n JSONObject repasses = new JSONObject();\n repasses.put("repasses", repass);\n\n \n // items\n JSONArray items = new JSONArray();\n JSONObject item1 = new JSONObject();\n item1.put("name", "Item 1");\n item1.put("amount", 1);\n item1.put("value", 1000);\n item1.put("marketplace",repasses);\n items.put(item1);\n \n //JSONObject body = new JSONObject();\n //body.put("items", items);\n \n //customer\n JSONObject customer = new JSONObject();\n customer.put("name", "Gorbadoc Oldbuck");\n customer.put("cpf", "94271564656");\n customer.put("phone_number", "5144916523");\n \n //URL de notifica\xe7\xf5es\n JSONObject metadata = new JSONObject();\n metadata.put("notification_url", "http://api.seuIp.com/notificacao");\n metadata.put("custom_id", "id_0007");\n \n //desconto \n JSONObject discount = new JSONObject();\n discount.put("type","currency");\n discount.put("value",400);\n \n //juros e mora\n JSONObject configurations = new JSONObject();\n configurations.put("fine", 200);\n configurations.put("interest", 33);\n \n //disconto condicional\n JSONObject conditional_discount = new JSONObject();\n conditional_discount.put("type","percentage");\n conditional_discount.put("value", 100);\n conditional_discount.put("until_date", "2022-09-13");\n \n \n JSONObject bankingBillet = new JSONObject();\n bankingBillet.put("expire_at", "2022-09-15");\n bankingBillet.put("customer", customer);\n bankingBillet.put("discount", discount);\n bankingBillet.put("configurations", configurations);\n bankingBillet.put("conditional_discount", conditional_discount);\n \n JSONObject payment = new JSONObject();\n payment.put("banking_billet", bankingBillet);\n JSONObject body = new JSONObject();\n body.put("payment", payment);\n body.put("items", items);\n body.put("metadata", metadata);\n \n try {\n Gerencianet gn = new Gerencianet(options);\n JSONObject response = gn.call("oneStep", new HashMap<String,String>(), body);\n System.out.println(response);\n }catch (GerencianetException e){\n System.out.println(e.getCode());\n System.out.println(e.getError());\n System.out.println(e.getErrorDescription());\n }\n catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }\n}\n'))),Object(r.b)(o.a,{value:"go",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-go"}),'package main\n import (\n "fmt"\n "github.com/gerencianet/gn-api-sdk-go/gerencianet"\n "../configs"\n)\n\nfunc main(){\n \n credentials := configs.Credentials\n gn := gerencianet.NewGerencianet(credentials)\n\n repassOne := map[string]interface{}{\n "payee_code": "informe_payee_code_conta", // identificador da conta Gerencianet (repasse 1)\n "percentage": 2500, // porcentagem de repasse (2500 = 25%)\n }\n\n repassTwo := map[string]interface{}{\n "payee_code": "informe_payee_code_conta", // identificador da conta Gerencianet (repasse 2)\n "percentage": 1500, // porcentagem de repasse (1500 = 15%)\n }\n \n customer := map[string]interface{}{\n "name": "Gorbadoc Oldbuck",\n "cpf": "04267484171",\n "phone_number": "51944916523",\n }\n\n body := map[string]interface{} {\n "payment": map[string]interface{} {\n "banking_billet": map[string]interface{} {\n "expire_at": "2022-09-13",\n "customer": customer,\n },\n },\n "items": []map[string]interface{}{\n {\n "name": "Product 1",\n "value": 500,\n "amount": 1,\n "marketplace": map[string]interface{}{\n "repasses": []map[string]interface{}{\n repassOne,\n repassTwo,\n },\n },\n },\n },\n "shippings": []map[string]interface{} {\n {\n "name": "Default Shipping Cost",\n "value": 100,\n },\n },\n }\n\n res, err := gn.CreateChargeOneStep(body) // no lugar do 1 coloque o charge_id certo\n\n if err != nil {\n fmt.Println(err)\n } else {\n fmt.Println(res)\n }\n}\n'))),Object(r.b)(o.a,{value:"ruby",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-js"}),'require "gerencianet"\nrequire_relative "./credentials"\n\noptions = {\n client_id: CREDENTIALS::CLIENT_ID,\n client_secret: CREDENTIALS::CLIENT_SECRET,\n sandbox: true\n}\n\nbody = {\n items: [{\n name: "Product 1",\n value: 1000,\n amount: 2,\n marketplace: {\n repasses: [{\n payee_code: "informe_payee_code_conta",\n percentage: 2500\n }, {\n payee_code: "informe_payee_code_conta",\n percentage: 1500\n }]\n }\n }],\n shippings: [{\n name: "Default Shipping Cost",\n value: 100\n }],\n payment: {\n banking_billet: {\n expire_at: "2022-09-25",\n customer: {\n name: "Gorbadoc Oldbuck",\n email: "[email protected]",\n cpf: "04267484171",\n birth: "1977-01-15",\n phone_number: "5144916523"\n }\n }\n }\n}\n\ngerencianet = Gerencianet.new(options)\nputs gerencianet.create_charge_onestep(body: body)\n'))),Object(r.b)(o.a,{value:"delphi",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),"interface\n\nfunction PayOneStepWithBilletMktPlace: String;\n\nimplementation\nuses uGerenciaClient, uGerenciaNetClientUtilities;\n{... your code ... }\n\nvar\n Body: String;\nbegin\n\n Repasse1 :=\n '{'+\n '\"payee_code\": \"informe_o_payee_code_1\",'+\n '\"percentage\": 2500'+\n '},';\n\n Repasse2 :=\n '{'+\n '\"payee_code\": \"informe_o_payee_code_2\",'+\n '\"percentage\": 1500'+\n '}';\n\n Repasses := '{ \"repasses\": ['+ Repasse1 + Repasse2 +'] }';\n\n Body :=\n '{'+\n '\"metadata\": {'+\n '\"custom_id\": \"id_0007\",'+\n '\"notification_url\": \"https://url-do-cliente.com.br/\"'+\n '},'+\n '\"payment\": {'+\n '\"banking_billet\": {'+\n '\"configurations\": {'+\n '\"fine\": 200,'+\n '\"interest\": 33'+\n '},'+\n '\"conditional_discount\": {'+\n '\"until_date\": \"2022-08-30\",'+\n '\"type\": \"percentage\",'+\n '\"value\": 500'+\n '},'+\n '\"discount\": {'+\n '\"type\": \"currency\",'+\n '\"value\": 599'+\n '},'+\n '\"expire_at\": \"2022-09-15\",'+\n '\"customer\": {'+\n '\"name\": \"Gorbadoc Oldbuck\",'+\n '\"cpf\": \"94271564656\",'+\n '\"phone_number\": \"5144916523\"'+\n '}'+\n '}'+\n '},'+\n '\"items\": ['+\n '{'+\n '\"amount\": 1,'+\n '\"name\": \"Item 1\",'+\n '\"value\": 600'+\n '},'+\n '{'+\n '\"amount\": 1,'+\n '\"name\": \"Item 2\",'+\n '\"value\": 1000'+\n '\"marketplace\":' + Repasses +\n '}'+\n ']'+\n '}';\n Result := ExecuteGerenciaNetRequest( 'payOneStep','','',Body );\nend;\n")))),Object(r.b)("br",null),Object(r.b)("h3",{id:"a-hierarchical-structure-of-schema-attributes-that-can-be-used"},"a) Hierarchical structure of Schema attributes that can be used:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{}),'"OneStep": "/Charge/one-step"\n "items"\n "name"\n "value"\n "amount"\n "marketplace"\n "payee_code"\n "percentage"\n "shippings"\n "name"\n "value"\n "payee_code"\n "metadata"\n "custom_id"\n "notification_url"\n "payment"\n "banking_billet"\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 "discount"\n "type"\n "percentage",\n "currency"\n "value"\n "conditional_discount"\n "type"\n "percentage",\n "currency"\n "value"\n "until_date"\n "configurations"\n "fine"\n "interest"\n "message"\n')),Object(r.b)("br",null),Object(r.b)("h3",{id:"b-attributes-that-can-be-used-to-create-a-title"},"b) Attributes that can be used to create a title:"),Object(r.b)("p",null,Object(r.b)("em",{parentName:"p"},"Object")," ",Object(r.b)("strong",{parentName:"p"},Object(r.b)("em",{parentName:"strong"},"items"))),Object(r.b)("table",null,Object(r.b)("tbody",null,Object(r.b)("tr",null,Object(r.b)("th",null,"Attribute"),Object(r.b)("th",{align:"center"},"Description"),Object(r.b)("th",{align:"center"},"Required"),Object(r.b)("th",{align:"center"},"Type")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"items")),Object(r.b)("td",{align:"left"},"item being sold. The same transaction can have unlimited items. ",Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("em",null,"Item attributes:"),Object(r.b)("br",null),Object(r.b)("code",null,"name*"),"// Name of the item, product or service. ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Minimum 1 character and maximum 255 characters (String)."),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"value*"),"// Value, in cents. Ex: R$ 10.00 = 1000. ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Integer"),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"amount"),"// Quantity. ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Integer (default: 1)"),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"marketplace"),"// Refers to the transfer settings. ",Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Attributes:"),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"payee_code")," // Gerencianet's account identifier code, unique per account - check (",Object(r.b)("a",{href:"https://s3.amazonaws.com/gerencianet-pub-prod-1/printscreen/2020/07/24/matheus.rodrigues/b66b15-d2201967-d646-4988-8e39-cffae37df203.png",target:"_blank"},"c\xf3digo identificador da conta Gerencianet"),") ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"(String)"),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"percentage*"),"(percentage of transfer, 9000 is equivalent to 90%) . ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Integer")),Object(r.b)("td",{align:"center"},"Yes"),Object(r.b)("td",{align:"center"},"Array")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"shippings")),Object(r.b)("td",{align:"left"},"Determines the shipping amount(s) for a transaction. The same transaction can have unlimited shipping values. ",Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("em",null,"Shipping attributes:"),Object(r.b)("br",null),Object(r.b)("code",null,"name*"),"// Shipping label. ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Maximum 255 characters. String."),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"value*"),"// Shipping value, in cents (1990 is equivalent to R$19.90). ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Integer")),Object(r.b)("td",{align:"center"},"No"),Object(r.b)("td",{align:"center"},"Array")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"metadata")),Object(r.b)("td",{align:"left"},"Defines transaction-specific data",Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("em",null,"Metadata attributes:"),Object(r.b)("br",null),Object(r.b)("code",null,"custom_id"),"// Allows you to associate a Gestornet 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(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Maximum 255 characters. String/null."),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"notification_url"),"// Address of your valid URL that will receive transaction status change notifications. ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Maximum 255 characters. String/null. ")),Object(r.b)("td",{align:"center"},"No"),Object(r.b)("td",{align:"center"},"Object")))),Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"Fields with * represent mandatory values")),Object(r.b)("br",null),Object(r.b)("p",null,Object(r.b)("em",{parentName:"p"},"Objeto")," ",Object(r.b)("strong",{parentName:"p"},Object(r.b)("em",{parentName:"strong"},"Payment"))),Object(r.b)("table",null,Object(r.b)("tbody",null,Object(r.b)("tr",null,Object(r.b)("th",null,"Attribute"),Object(r.b)("th",{align:"center"},"Description"),Object(r.b)("th",{align:"center"},"Required"),Object(r.b)("th",{align:"center"},"Type")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"banking_billet")),Object(r.b)("td",{align:"left"},'Payment method via "boleto banc\xe1rio"'),Object(r.b)("td",{align:"center"},"Yes"),Object(r.b)("td",{align:"center"},"Objeto")))),Object(r.b)("br",null),Object(r.b)("p",null,Object(r.b)("em",{parentName:"p"},"Object")," ",Object(r.b)("strong",{parentName:"p"},Object(r.b)("em",{parentName:"strong"},"Banking_Billet"))),Object(r.b)("table",null,Object(r.b)("tbody",null,Object(r.b)("tr",null,Object(r.b)("th",null,"Attribute"),Object(r.b)("th",{align:"center"},"Description"),Object(r.b)("th",{align:"center"},"Required"),Object(r.b)("th",{align:"center"},"Type")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"name")),Object(r.b)("td",{align:"left"},"Customer's name",Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Minimum of 1 character and maximum of 255 characters (String).")),Object(r.b)("td",{align:"center"},"Yes ",Object(r.b)("br",null),"Obs: For Juridical Person, the name and CPF will not be mandatory, only the other customer data. "),Object(r.b)("td",{align:"center"},"String")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"cpf")),Object(r.b)("td",{align:"left"},"Valid customer ID (no dots, commas or hyphens).",Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Size: 11 characters. ")),Object(r.b)("td",{align:"center"},"Yes ",Object(r.b)("br",null),"Obs: For Juridical Person, the name and CPF will not be mandatory, only the other customer data. "),Object(r.b)("td",{align:"center"},"String")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"email")),Object(r.b)("td",{align:"left"},"Customer's email.",Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Maximum of 255 characters. Ex.: [email protected]")),Object(r.b)("td",{align:"center"},"No"),Object(r.b)("td",{align:"center"},"String")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"phone_number")),Object(r.b)("td",{align:"left"},"Customer's phome number.",Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Format: without periods or commas, with 2-character area code (9th digit is optional). Ex.: 11988887777")),Object(r.b)("td",{align:"center"},"Yes"),Object(r.b)("td",{align:"center"},"String")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"birth")),Object(r.b)("td",{align:"left"},"Customer's date of birth.",Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Format: YYYY-MM-DD")),Object(r.b)("td",{align:"center"},"No"),Object(r.b)("td",{align:"center"},"String")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"address")),Object(r.b)("td",{align:"left"},"Customer address.",Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("em",null,"Address attributes:"),Object(r.b)("br",null),Object(r.b)("code",null,"street*"),"// Street name ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"}," (Object)"),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"number*"),"// House number ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"(String/Integer)"),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"neighborhood*")," ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"(String)"),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"zipcode*"),"// CEP (no dots or hyphen, 8 characters) ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"(String)"),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"city*"),"// City ",Object(r.b)(s,{color:"#009615 ",mdxType:"Highlight"},"(String)"),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"complement")," ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"(String/null)"),Object(r.b)("br",null)," ",Object(r.b)("br",null)," ",Object(r.b)("code",null,"state*"),"// State (2 characters) ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"(Object)")),Object(r.b)("td",{align:"center"},"No"),Object(r.b)("td",{align:"center"},"Object")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"juridical_person")),Object(r.b)("td",{align:"left"},"Juridical person data.",Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("em",null,"Attributes of juridical_person:"),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"corporate_name*"),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Minimum of 1 character and maximum of 255. String."),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"cnpj*"),"// CNPJ of the company. ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Size: 14 characters. String.")),Object(r.b)("td",{align:"center"},"No"),Object(r.b)("td",{align:"center"},"Object")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"expire_at")),Object(r.b)("td",{align:"left"},"Charge's expiration date. ",Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Format: YYYY-MM-DD")),Object(r.b)("td",{align:"center"},"Yes"),Object(r.b)("td",{align:"center"},"String")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"discount")),Object(r.b)("td",{align:"left"},"Defines discount data about the charge.",Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("em",null,"Discount attributes:"),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"type*")," // Type of discount (String). Allowed values: ",Object(r.b)("br",null),Object(r.b)("code",null,"currency"),": the discount will be reported in cents. ",Object(r.b)("code",null,"percentage"),": the discount will be informed in percentage.",Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"cnpj*"),"// CNPJ of the company. ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Size: 14 characters. String."),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"value*"),"// Discount value (Integer). If the discount type is ",Object(r.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(r.b)("code",null,"percentage"),", the value must be multiplied by 100 ( 1500 is equivalent to 15%). Examples: ",Object(r.b)("br",null),"1)",Object(r.b)("code",null,"currency"),"// must be informed in cents, that is, if the discount will be R$ 5.99, the integrator must inform ",Object(r.b)("code",null,"599")," ;",Object(r.b)("br",null)," 2)",Object(r.b)("code",null,"percentage")," // must be informed in cents, that is, if the discount is 15%, the integrator must inform ",Object(r.b)("code",null,"1500 "),".",Object(r.b)("br",null),Object(r.b)("br",null)),Object(r.b)("td",{align:"center"},"No"),Object(r.b)("td",{align:"center"},"Object")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"conditional_discount")),Object(r.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(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("em",null,"Attributes of conditional_discount:"),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"type*"),"// Discount type (String). Allowed values: ",Object(r.b)("br",null),Object(r.b)("code",null,"currency"),": the discount will be reported in cents. ",Object(r.b)("br",null),Object(r.b)("code",null,"percentage"),": the discount will be informed in percentage.",Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"cnpj*"),"// CNPJ of the company. ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Size: 14 characters. String."),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"value*"),"// Discount value (Integer). If the discount type is ",Object(r.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(r.b)("code",null,"percentage"),", the value must be multiplied by 100 (1500 is equivalent to 15%). Examples: ",Object(r.b)("br",null),"1)",Object(r.b)("code",null,"currency"),"// must be informed in cents, that is, if the discount will be R$ 5.99, the integrator must inform ",Object(r.b)("code",null,"599")," ;",Object(r.b)("br",null)," 2)",Object(r.b)("code",null,"percentage")," // must be informed in cents, that is, if the discount is 15%, the integrator must inform ",Object(r.b)("code",null,"1500"),".",Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"until_date*"),", // Maximum date the discount will be granted. (String).",Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Format: YYYY-MM-DD")),Object(r.b)("td",{align:"center"},"No"),Object(r.b)("td",{align:"center"},"Object")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"configurations")),Object(r.b)("td",{align:"left"},"Allows you to include a fine and interest in the charge if it is paid after the due date.",Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("em",null,"Configuration attributes:"),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"}," fine"),"// Amount charged for fine after expiration. For example: if you want 2%, you would enter ",Object(r.b)("code",null,"200"),".",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Minimum of 0 and maximum of 1000. Integer."),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"If you have fine settings enabled in Gerencianet and want to generate API emissions without fines, use ",Object(r.b)("code",null,"0")," as the value of the ",Object(r.b)("code",null,"fine")," attribute "),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.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(r.b)("code",null,"33"),".",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Minimum of 0 and maximum of 330. Integer."),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"If you have fine settings activated in Gestoret and want to generate interest-free API issues, use ",Object(r.b)("code",null,"0")," as the value of the ",Object(r.b)("code",null,"interest attribute "))),Object(r.b)("td",{align:"center"},"No"),Object(r.b)("td",{align:"center"},"Object")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"message")),Object(r.b)("td",{align:"left"},'Allows you to include an "observation" in the charge, or in other words, a message for the customer. This message can be seen in e-mails related to billing, on the payment via boleto or carn\xca.',Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Up to 4 lines containing 100 characters in each line. String. ",Object(r.b)("br",null),"The ",Object(r.b)("code",null,"\\n")," operator is used to perform the line break .")),Object(r.b)("td",{align:"center"},"No"),Object(r.b)("td",{align:"center"},"String")))),Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"Fields with * represent mandatory values")),Object(r.b)("br",null),Object(r.b)("h2",{id:"2-creating-a-marketplace-transaction-in-two-steps"},"2. Creating a Marketplace transaction in Two Steps"),Object(r.b)("p",null,"To create a Marketplace transaction by the traditional method, it is necessary to follow the steps listed below:"),Object(r.b)("p",null,"2.1. ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"#21-criar-transa%C3%A7%C3%A3o-de-marketplace"}),"Create marketplace transaction"),", informing transfer account(s), item/product/service, value, quantity, etc;"),Object(r.b)("p",null,"2.2. ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"#22-associar-%C3%A0-forma-de-pagamento-via-boleto-ou-cart%C3%A3o"}),"Associate with the desired payment method"),", informing the transaction's ",Object(r.b)("code",null,"charge_id")," and the paying customer's data."),Object(r.b)("p",null,"The rest of this page has the detailed procedures, but you need to install one of our libraries on your server to run the sample code. ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"../Instalacao/introducao"}),"Make sure the Gerencianet SDK has been installed "),"."),Object(r.b)("hr",null),Object(r.b)("h3",{id:"21-creating-a-marketplace-transaction"},"2.1 Creating a Marketplace transaction"),Object(r.b)("p",null,'Transactions that have at least one item defined as a marketplace item or shipping amounts destined for accounts other than the integrating account are considered "Marketplace Transactions". With the Gerencianet marketplace it is possible for the amount paid by the end customer to be automatically divided between seller and supplier, without the process having to be carried out manually.'),Object(r.b)("p",null,"First, we need to generate the transaction. It is at this moment that the Gerencianet account(s), the name of the item/product/service, transaction value, quantity, among other possible information, will be informed."),Object(r.b)("p",null,"An important observation is that the Gerencianet intermediation tax is charged proportionally to all accounts that receive the transfers, therefore, all those involved need a Gerencianet account."),Object(r.b)("p",null,"The code below exemplifies the use of transfers, in which the total amount of the transaction is R$ ",Object(r.b)("strong",null,"50.00"),". According to the code below, the amount will be divided between 3 (three) Gerencianet accounts. The first account will have ",Object(r.b)("strong",null,"25%")," of the value, the second account will have ",Object(r.b)("strong",null,"15%")," of the value and the third account will have the remainder, which in this case is ",Object(r.b)("strong",null,"60% ")," of the value. "),Object(r.b)("p",null,"The ",Object(r.b)("code",null,"payee_code"),' attribute refers to the Gerencianet "account identifier" and will be used to identify the accounts that will receive the transfers. Check out where to find it on your platform (',Object(r.b)("a",{href:"https://s3.amazonaws.com/gerencianet-pub-prod-1/printscreen/2020/07/24/matheus.rodrigues/b66b15-d2201967-d646-4988-8e39-cffae37df203.png",target:"_blank"},"veja onde localizar"),")."),Object(r.b)("p",null,"If you want, you can explore and learn more about this feature (using our Playground)","[../AmbienteTestes/PlaygroundTransacoes#post-v1charge]","."),Object(r.b)("p",null,"The example below shows how this can be done, using the SDK's available: "),Object(r.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(r.b)(o.a,{value:"php",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.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$repass_1 = [\n 'payee_code' => \"informe_payee_code_conta\", // identificador da conta Gerencianet (repasse 1)\n 'percentage' => 2500 // porcentagem de repasse (2500 = 25%)\n];\n \n$repass_2 = [\n 'payee_code' => \"informe_payee_code_conta\", // identificador da conta Gerencianet (repasse 2)\n 'percentage' => 1500 // porcentagem de repasse (1500 = 15%)\n];\n \n$repasses = [\n $repass_1,\n $repass_2\n];\n \n$item_1 = [\n 'name' => 'Meu Produto', // nome do item, produto ou servi\xe7o\n 'amount' => 1, // quantidade\n 'value' => 5000, // valor (5000 = R$ 50,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 'marketplace'=>array('repasses'=>$repasses)\n];\n \n$items = [\n $item_1\n];\n \n// Exemplo para receber notifica\xe7\xf5es da altera\xe7\xe3o do status da transa\xe7\xe3o.\n// $metadata = ['notification_url'=>'sua_url_de_notificacao_.com.br']\n\n// Como enviar seu $body com o $metadata\n// $body = [\n// 'items' => $items,\n// 'metadata' => $metadata\n// ];\n\n$body = [\n 'items' => $items\n];\n \ntry {\n $api = new Gerencianet($options);\n $charge = $api->createCharge([], $body);\n \n print_r($charge);\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(r.b)(o.a,{value:"python",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-py"}),"from gerencianet import Gerencianet\n \noptions = {\n 'client_id': 'informe_seu_client_id',\n 'client_secret': 'informe_seu_client_secret',\n 'sandbox': True\n}\n \ngn = Gerencianet(options)\n \nbody = {\n 'items': [{\n 'name': \"Meu Produto\",\n 'value': 5000,\n 'amount': 1,\n 'marketplace': {\n 'repasses': [{\n 'payee_code': \"informe_payee_code_conta\",\n 'percentage': 2500\n },{\n 'payee_code': \"informe_payee_code_conta\",\n 'percentage': 1500\n }]\n }\n }],\n 'metadata': {\n 'notification_url': \"http://yourdomain.com\"\n }\n}\n \nresponse = gn.create_charge(body=body)\nprint (response)\n"))),Object(r.b)(o.a,{value:"js",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-js"}),"'use strict';\n \nvar Gerencianet = require('gn-api-sdk-node');\n \nvar clientId = 'informe_seu_client_id';\nvar clientSecret = 'informe_seu_client_secret';\n \nvar options = {\n client_id: clientId,\n client_secret: clientSecret,\n sandbox: true\n}\n \nvar body = {\n items: [{\n name: 'Meu Produto',\n value: 5000,\n amount: 1,\n marketplace: {\n repasses: [{\n payee_code: \"informe_payee_code_conta\",\n percentage: 2500\n }, {\n payee_code: \"informe_payee_code_conta\",\n percentage: 1500\n }]\n }\n }]\n}\n \nvar gerencianet = new Gerencianet(options);\n \ngerencianet\n .createCharge({}, body)\n .then(console.log)\n .catch(console.log)\n .done();\n"))),Object(r.b)(o.a,{value:"c",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-js"}),'dynamic endpoints = new Endpoints("informe_seu_client_id", "informe_seu_client_secret", true);\n \nvar body = new {\n items = new [] {\n new {\n name = "Meu Produto",\n value = 5000,\n amount = 1,\n marketplace = new {\n repasses = new [] {\n new {\n payee_code = "informe_payee_code_conta",\n percentage = 2500\n },\n new {\n payee_code = "informe_payee_code_conta",\n percentage = 1500\n }\n }\n }\n }\n },\n metadata = new {\n notification_url = "http://yourdomain.com"\n }\n};\n \nvar response = endpoints.CreateCharge(null, body);\n'))),Object(r.b)(o.a,{value:"java",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.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/marketplace/json/Marketplace.java\n\n\nMap<String, Object>\n\nhttps://github.com/gerencianet/gn-api-sdk-java-examples/blob/master/src/main/java/br/com/gerencianet/marketplace/map/Marketplace.java\n\n*/\n'))),Object(r.b)(o.a,{value:"go",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.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 repassOne := map[string]interface{}{\n "payee_code": "informe_payee_code_conta", // identificador da conta Gerencianet (repasse 1)\n "percentage": 2500, // porcentagem de repasse (2500 = 25%)\n }\n\n repassTwo := map[string]interface{}{\n "payee_code": "informe_payee_code_conta", // identificador da conta Gerencianet (repasse 2)\n "percentage": 1500, // porcentagem de repasse (1500 = 15%)\n }\n\n body := map[string]interface{}{\n "items": []map[string]interface{}{\n {\n "name": "Product 1",\n "value": 1000,\n "amount": 2,\n "marketplace": map[string]interface{}{\n "repasses": []map[string]interface{}{\n repassOne,\n repassTwo,\n },\n },\n },\n },\n "shippings": []map[string]interface{} {\n {\n "name": "Default Shipping Cost",\n "value": 100,\n },\n },\n }\n\n res, err := gn.CreateCharge(body)\n\n if err != nil {\n fmt.Println(err)\n } else {\n fmt.Println(res)\n }\n}\n'))),Object(r.b)(o.a,{value:"ruby",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-js"}),'require "gerencianet"\nrequire_relative "./credentials"\n \noptions = {\n client_id: "informe_seu_client_id",\n client_secret: "informe_seu_client_secret",\n sandbox: true\n}\n \nbody = {\n items: [{\n name: "Meu Produto",\n value: 5000,\n amount: 1,\n marketplace: {\n repasses: [{\n payee_code: "informe_payee_code_conta",\n percentage: 2500\n }, {\n payee_code: "informe_payee_code_conta",\n percentage: 1500\n }]\n }\n }]\n}\n \ngerencianet = Gerencianet.new(options)\ngerencianet.create_charge(body: body)\n'))),Object(r.b)(o.a,{value:"delphi",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),"interface\nfunction CreateCharge: String;\n\nimplementation\nuses uGerenciaClient, uGerenciaNetClientUtilities;\n{... your code ... }\n\nfunction CreateCharge: String;\nvar \nBody : String;\nRepasse1 : String;\nRepasse2 : String;\nRepasses : String;\n\nbegin \n EnableService( 'GerenciaNet.dll' ); \n ConfigureService( ToPAnsiChar( 'client_id' ),ToPAnsiChar( 'client_secret' ),'sandbox','config.json',''); \n GerenciaNetAuthorize(); \n\n Repasse1 :=\n '{'+\n '\"payee_code\": \"informe_o_payee_code_1\",'+\n '\"percentage\": 2500'+\n '},';\n\n Repasse2 :=\n '{'+\n '\"payee_code\": \"informe_o_payee_code_2\",'+\n '\"percentage\": 1500'+\n '}';\n\n Repasses := '{ \"repasses\": ['+ Repasse1 + Repasse2 +'] }';\n\n Body := '{'+\n '\"items\":'+\n '['+\n '{'+\n '\"name\":\"Meu Produto\",'+\n '\"value\":9000,'+\n '\"amount\":1,'+\n '\"marketplace\":' + Repasses +\n '}'+\n ']'+\n '}';\n\n Result := ExecuteGerenciaNetRequest( 'createCharge','','',Body );\nend;\n")))),Object(r.b)("br",null),Object(r.b)("h3",{id:"a-hierarchical-structure-of-schema-attributes-that-can-be-used-1"},"a) Hierarchical structure of Schema attributes that can be used:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{}),'"id": "/Charge"\n "items"\n "name"\n "value"\n "amount"\n "marketplace"\n "payee_code"\n "percentage"\n "shippings"\n "name"\n "value"\n "payee_code"\n "metadata"\n "custom_id"\n "notification_url"\n')),Object(r.b)("p",null,"Para verificar mais detalhes, acesse aqui e explore em nosso Playground."),Object(r.b)("br",null),Object(r.b)("h3",{id:"battributes-that-can-be-used-to-create-a-transaction"},"b)Attributes that can be used to create a transaction:"),Object(r.b)("table",null,Object(r.b)("tbody",null,Object(r.b)("tr",null,Object(r.b)("th",null,"Attribute"),Object(r.b)("th",{align:"center"},"Description"),Object(r.b)("th",{align:"center"},"Required"),Object(r.b)("th",{align:"center"},"Type")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"items")),Object(r.b)("td",{align:"left"},"item being sold. The same transaction can have unlimited items. ",Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("em",null,"Item attributes:"),Object(r.b)("br",null),Object(r.b)("code",null,"name*"),"// Name of the item, product or service. ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Minimum 1 character and maximum 255 characters (String)."),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"value*"),"// Value, in cents. Ex: R$ 10.00 = 1000. ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Integer"),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"amount"),"// Quantity. ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Integer (default: 1)"),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"marketplace"),"// Refers to the transfer settings. ",Object(r.b)("br",null),Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Attributes:"),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"payee_code")," // Manager account identifier code, unique per account - check (",Object(r.b)("a",{href:"https://s3.amazonaws.com/gerencianet-pub-prod-1/printscreen/2020/07/24/matheus.rodrigues/b66b15-d2201967-d646-4988-8e39-cffae37df203.png",target:"_blank"},"c\xf3digo identificador da conta Gerencianet"),") ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"(String)"),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("code",null,"percentage*"),"(percentage of transfer, with 9000 being equivalent to 90%).",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Integer")),Object(r.b)("td",{align:"center"},"Yes"),Object(r.b)("td",{align:"center"},"Array")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"shippings")),Object(r.b)("td",{align:"left"},"Determina o(s) valor(es) de frete(s) de uma transa\xe7\xe3o. Uma mesma transa\xe7\xe3o pode possuir ilimitados valores de frete. ",Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("em",null,"Atributos de shippings:"),Object(r.b)("br",null),Object(r.b)("code",null,"name*"),"// R\xf3tulo do frete. ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"M\xe1ximo de 255 caracteres. String."),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"value*"),"// Valor do frete, em centavos (1990 equivale a R$19,90). ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Integer")),Object(r.b)("td",{align:"center"},"No"),Object(r.b)("td",{align:"center"},"Array")),Object(r.b)("tr",null,Object(r.b)("td",null,Object(r.b)("code",null,"metadata")),Object(r.b)("td",{align:"left"},"Defines transaction-specific data",Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("em",null,"Metadata attributes:"),Object(r.b)("br",null),Object(r.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(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Maximum 255 characters. String/null."),Object(r.b)("br",null),Object(r.b)("br",null)," ",Object(r.b)("code",null,"notification_url"),"// Address of your valid URL that will receive transaction status change notifications. ",Object(r.b)(s,{color:"#009615",mdxType:"Highlight"},"Maximum 255 characters. String/null. ")),Object(r.b)("td",{align:"center"},"No"),Object(r.b)("td",{align:"center"},"Object")))),Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"Fields with * represent mandatory values")," "),Object(r.b)("br",null),Object(r.b)("hr",null),Object(r.b)("h3",{id:"22-associate-with-the-payment-method-via-boleto-or-card"},"2.2. Associate with the payment method via boleto or card"),Object(r.b)("p",null,"After creating the marketplace transaction, you will receive the ",Object(r.b)("code",null,"charge_id"),". It will be used for you to define the payment method for that transaction."),Object(r.b)("p",null,"For details, access the page referring to the form you want: ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"../PagamentoBoleto/GerarBoleto"}),"boleto banc\xe1rio")," and ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"../PagamentoCartao/PagamentoCartao.md"}),"credit card"),"."),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("h2",{id:"3-videos-marketplace"},"3. Videos: Marketplace"),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 create a marketplace transaction through integration with the Gestoret API. "),Object(r.b)("h3",{id:"31overview---getting-to-know-the-marketplace-gerencianet-api-integration"},"3.1.Overview - Getting to Know the Marketplace (Gerencianet API integration)"),Object(r.b)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/l1epJxBFUvM",frameborder:"0",allowfullscreen:!0}),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("h3",{id:"32-creating-transaction-via-marketplace-gerencianet-api-integration"},"3.2. Creating transaction via Marketplace (Gerencianet API integration)"),Object(r.b)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/3SdgVG2RfrA",frameborder:"0",allowfullscreen:!0}),Object(r.b)("br",null),Object(r.b)("br",null),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},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:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.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's API")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"For access to other classes, on other subjects, access the page ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"../CursosIntegracao/CursoOnline"}),"Online Integration Course"),"."))),Object(r.b)("br",null),Object(r.b)("hr",null),Object(r.b)("h2",{id:"4-next-steps"},"4. Next steps"),Object(r.b)("p",null,"Let's get to know more about the details of the marketplace's working mechanism? "),Object(r.b)("a",{href:"../Marketplace/ComoFunciona",target:"_blank",title:"Link Interno"},Object(r.b)("button",{type:"button",className:"buttonModify button1"},"How the Gerencianet's Marketplace works?"))))}p.isMDXComponent=!0},250:function(e,n,t){"use strict";t.d(n,"a",(function(){return u})),t.d(n,"b",(function(){return m}));var a=t(0),c=t.n(a);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function o(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?i(Object(t),!0).forEach((function(n){r(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function l(e,n){if(null==e)return{};var t,a,c=function(e,n){if(null==e)return{};var t,a,c={},r=Object.keys(e);for(a=0;a<r.length;a++)t=r[a],n.indexOf(t)>=0||(c[t]=e[t]);return c}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)t=r[a],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(c[t]=e[t])}return c}var b=c.a.createContext({}),s=function(e){var n=c.a.useContext(b),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},u=function(e){var n=s(e.components);return c.a.createElement(b.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return c.a.createElement(c.a.Fragment,{},n)}},p=c.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,r=e.originalType,i=e.parentName,b=l(e,["components","mdxType","originalType","parentName"]),u=s(t),p=a,m=u["".concat(i,".").concat(p)]||u[p]||d[p]||r;return t?c.a.createElement(m,o(o({ref:n},b),{},{components:t})):c.a.createElement(m,o({ref:n},b))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var r=t.length,i=new Array(r);i[0]=p;var o={};for(var l in n)hasOwnProperty.call(n,l)&&(o[l]=n[l]);o.originalType=e,o.mdxType="string"==typeof e?e:a,i[1]=o;for(var b=2;b<r;b++)i[b]=t[b];return c.a.createElement.apply(null,i)}return c.a.createElement.apply(null,t)}p.displayName="MDXCreateElement"},254:function(e,n,t){"use strict";function a(e){var n,t,c="";if("string"==typeof e||"number"==typeof e)c+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;n<e.length;n++)e[n]&&(t=a(e[n]))&&(c&&(c+=" "),c+=t);else for(n in e)e[n]&&(c&&(c+=" "),c+=n);return c}n.a=function(){for(var e,n,t=0,c="";t<arguments.length;)(e=arguments[t++])&&(n=a(e))&&(c&&(c+=" "),c+=n);return c}},255:function(e,n,t){"use strict";var a=t(0);const c=Object(a.createContext)({tabGroupChoices:{},setTabGroupChoices:()=>{},isAnnouncementBarClosed:!1,closeAnnouncementBar:()=>{}});n.a=c},256:function(e,n,t){"use strict";var a=t(0),c=t(255);n.a=function(){return Object(a.useContext)(c.a)}},257:function(e,n,t){"use strict";var a=t(0),c=t.n(a),r=t(256),i=t(254),o=t(92),l=t.n(o);const b=37,s=39;n.a=function(e){const{block:n,children:t,defaultValue:o,values:u,groupId:d}=e,{tabGroupChoices:p,setTabGroupChoices:m}=Object(r.a)(),[O,g]=Object(a.useState)(o);if(null!=d){const e=p[d];null!=e&&e!==O&&u.some(n=>n.value===e)&&g(e)}const j=e=>{g(e),null!=d&&m(d,e)},h=[];return c.a.createElement("div",null,c.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(i.a)("tabs",{"tabs--block":n})},u.map(({value:e,label:n})=>c.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=>h.push(e),onKeyDown:e=>((e,n,t)=>{switch(t.keyCode){case s:((e,n)=>{const t=e.indexOf(n)+1;e[t]?e[t].focus():e[0].focus()})(e,n);break;case b:((e,n)=>{const t=e.indexOf(n)-1;e[t]?e[t].focus():e[e.length-1].focus()})(e,n)}})(h,e.target,e),onFocus:()=>j(e),onClick:()=>j(e)},n))),c.a.createElement("div",{role:"tabpanel",className:"margin-vert--md"},a.Children.toArray(t).filter(e=>e.props.value===O)[0]))}},258:function(e,n,t){"use strict";var a=t(0),c=t.n(a);n.a=function(e){return c.a.createElement("div",null,e.children)}}}]);