{"_id":"5785269a2eca4e0e002b4c41","parentDoc":null,"project":"575aeffae12cf20e002f306c","version":{"_id":"575aeffae12cf20e002f306f","project":"575aeffae12cf20e002f306c","__v":30,"createdAt":"2016-06-10T16:51:06.080Z","releaseDate":"2016-06-10T16:51:06.080Z","categories":["575aeffae12cf20e002f3070","575af039a083950e004487f7","575af5c7ba4ed70e000ca288","57602fe5b82256240055c657","57602ff6c811102000cef302","576030909b1a9a220067ca40","57604518b82256240055c722","5761a63d207db7170022fc14","5761b9a2b65324200072d79e","576832939f0bf4190014ffdf","576832c09f0bf4190014ffe1","576832cba151c10e004316f0","576832d5bb15f40e00a288ec","576832e107b1f30e0039c645","577680bf3cee3a0e00a000bc","577ff3b1ff48990e000c6806","5783f78c5cbce30e0074e2b7","5783f86292edb92200e6101c","5783f86dbfbba719003f0d8b","5783f8755cbce30e0074e2b8","5783f8b65cbce30e0074e2b9","5783f8bf5cbce30e0074e2ba","5783f8d8ce802f0e0087d574","578529f887c9280e0090394b","57852aeb87c9280e0090394d","57866e72b2f4060e00fa39ca","57ab6d5c39c2fd1900191879","57f39451ab0ee12000bef915","582499a0d90fa027009b259e","58c29df1258e5a1900b60478"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"2016","version_clean":"1.0.0","version":"1"},"user":"57601a13af3e090e00108059","category":{"_id":"5783f8d8ce802f0e0087d574","version":"575aeffae12cf20e002f306f","project":"575aeffae12cf20e002f306c","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-07-11T19:51:52.428Z","from_sync":false,"order":9,"slug":"checkout-via-ligthbox","title":"Checkout via Ligthbox"},"__v":6,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-07-12T17:19:22.842Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"O checkout via lightbox é o tipo de integração da Gerencianet em que não há necessidade de o integrador ter uma tela de pagamento. Sua tela de pagamento será o lightbox.\n\nApesar de ser um facilitador, o lightbox requer que a integração no backend seja realizada normalmente.\n\nPara prosseguir com a execução dos códigos a seguir, [certifique-se que a SDK da Gerencianet foi instalada](https://dev.gerencianet.com.br/docs#section-bibliotecas).\n\n\n## Adicionando o lightbox em sua página\n\nPrimeiramente, será necessário adicionar um script em sua página que disponibiliza as funções necessárias à construção e funcionamento do lightbox.\n[block:html]\n{\n  \"html\": \"<p>Para gerar o código Javascript específico de sua conta Gerencianet, insira no campo abaixo o seu \\\"identificador da conta\\\" (<a target=\\\"blank\\\" href=\\\"http://image.prntscr.com/image/cabe13e1e5b64449b942cf31139150ba.png\\\" class=\\\"block-display-image-parent block-display-image-size-smart\\\"><img>onde localizo?</img></a>) e clique no botão \\\"Gerar\\\". Cabe frisar que é preciso estar logado em sua conta Gerencianet para visualizar o identificador de sua conta.</p>\\n\\n<input id=\\\"input_code_ck\\\" type=\\\"text\\\" > <button id=\\\"get_code_ck\\\">Gerar</button> \\n<div id=\\\"resultado_code_js_ck\\\"></div>\"\n}\n[/block]\nApós a inserção do script, as seguintes funções ficarão disponíveis:\n\n- <code>ready()</code>\n- <code>lightbox()</code>\n- <code>show()</code>\n\n\n### $gn.ready ( callback )\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parâmetros\",\n    \"h-1\": \"Tipo\",\n    \"h-2\": \"Descrição\",\n    \"0-0\": \"callback<span class=\\\"obrigatorio\\\">*</span>\",\n    \"0-1\": \"Function\",\n    \"0-2\": \"Função de inicialização que possibilita a chamada das demais funções.\\n\\n<span class=\\\"tab1\\\"><em>Parâmetro(s) de callback</em><div>\\n\\n<div class=\\\"tab2\\\"><code>object <span class=\\\"obrigatorio\\\">*</span></code></span>, Objeto que recebe as instâncias das outras funções.</div>\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n<strong class=\"atributo-obrigatorio-texto\">* valor obrigatório</strong>\n\n\n### lightbox ( available_payment_forms )\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parâmetros\",\n    \"h-1\": \"Tipo\",\n    \"h-2\": \"Descrição\",\n    \"0-0\": \"available_payment_forms<span class=\\\"obrigatorio\\\">*</span>\",\n    \"0-1\": \"Array\",\n    \"0-2\": \"Array com a(s) forma(s) de pagamento que o lightbox contemplará.\\n\\nAs opções disponíveis são:\\n- banking_billet (boleto bancário);\\n- credit_card (cartão de crédito).\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n<strong class=\"atributo-obrigatorio-texto\">* valor obrigatório</strong>\n\n\n### show ( data )\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parâmetros\",\n    \"0-0\": \"data<strong class=\\\"atributo-obrigatorio\\\">*</strong>\",\n    \"h-1\": \"Tipo\",\n    \"h-2\": \"Descrição\",\n    \"0-1\": \"Object\",\n    \"0-2\": \"Objeto com as informações essencias para a construção do lightbox. Os atributos são:\\n\\n<div class=\\\"tab2\\\"><code>items<span class=\\\"obrigatorio\\\">*</span></code>, Array com os items que serão adquiridos pelo cliente. Cada instância deste array será um objeto que deverá ter, obrigatoriamente, name e value (<strong class=\\\"atributo\\\">valor inteiro, ex.: R$ 123,00 = 12300</strong>). As instâncias também poderão ter amount, cujo valor padrão é 1.</div>\\n\\n<div class=\\\"tab2\\\">\\n<code>actionForm<span class=\\\"obrigatorio\\\">*</span></code>, URL do backend para onde serão enviadas as informações coletadas do cliente.</div>\\n\\n<div class=\\\"tab2\\\"><code>shippingCosts</code>, Valor do frete, em inteiro. (<strong class=\\\"atributo\\\">R$ 50,00 = 5000</strong>)</div>\\n\\n<div class=\\\"tab2\\\"><code>customer</code>, Boolean que indica se deverá solicitar os dados do cliente (true) ou não (false). O valor padrão é true.</div>\\n\\n<div class=\\\"tab2\\\"> <code>shippingAddress</code>, Boolean que indica se deverá solicitar os dados de endereço de entrega (true) ou não (false). O valor padrão é true.</strong>\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n<strong class=\"atributo-obrigatorio-texto\">* valor obrigatório</strong>\n\n<br />\nCom o script adicionado, você deverá chamar a função <code>ready()</code> e, em sua função de callback, chamar a função <code>lightbox()</code> para que a sua página já seja preparada para o lightbox.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$gn.ready(function(obj) {\\n \\n  var payment_forms = [\\\"credit_card\\\", \\\"banking_billet\\\"];\\n  obj.lightbox(payment_forms);\\n \\n});\",\n      \"language\": \"javascript\",\n      \"name\": \" \"\n    }\n  ]\n}\n[/block]\n \n<br />\nOutra alteração necessária é no botão que abrirá o lightbox, onde você deverá adicionar o atributo <code>rel=\"gn_lightbox\"</code> e a função <code>show()</code> para o click no botão.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!DOCTYPE html>\\n  <head>\\n    <script>\\n      $gn.ready(function(obj){\\n \\n        ...\\n \\n        obj.jq('#button_lightbox').click(function(evt) {\\n \\n          var data = {\\n            items: [\\n              {\\n                name: 'Item 1', // nome do item, produto ou serviço\\n                value: 12000 // valor (12000 = R$ 120,00)\\n              },\\n              {\\n                name: 'Item 2', // nome do item, produto ou serviço\\n                value: 4000, // valor (4000 = R$ 40,00)\\n                amount: 1 // quantidade\\n              }\\n            ],\\n            shippingCosts: 3560,\\n            actionForm: 'http://your_domain/your_backend_url'\\n          };\\n \\n          obj.show(data);\\n \\n        });\\n \\n      });\\n    </script>\\n  </head>\\n \\n  <body>\\n    <button rel=\\\"gn_lightbox\\\" id='button_lightbox'>\\n      Open Lightbox\\n    </button>\\n  </body>\\n</html>\",\n      \"language\": \"html\",\n      \"name\": \" \"\n    }\n  ]\n}\n[/block]\nCom estas implementações, o lightbox já poderá ser aberto em sua página, porém ainda será necessário realizar a integração no backend para que ele tenha um funcionamento correto.\n\n\n## Realizando a integração\n\nO lightbox funciona como uma tela de pagamento para seu site ou aplicação. Quando o comprador preencher os campos e realizar o pagamento no lightbox, um POST será enviado para a URL informada no parâmetro *actionForm*, contendo os dados para a finalização da compra.\n\nPara a concretização do pagamento, o programador deverá fazer a integração detalhada no menu <a href=\"https://docs.gerencianet.com.br/transacoes/introducao\" target=\"_blank\">Transações</a>.\n\nA resposta desta URL deve ser o conteúdo retornado no webservice de pagamento de transação (/payment/pay) no formato JSON para que o lightbox possa avaliá-la e exibir a tela de sucesso ou de erro para o comprador.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n \\nrequire __DIR__.'/../../vendor/autoload.php'; // caminho relacionado a SDK\\n \\nuse Gerencianet\\\\Exception\\\\GerencianetException;\\nuse Gerencianet\\\\Gerencianet;\\n \\n$clientId = 'your_client_id';\\n$clientSecret = 'your_client_secret';\\n \\n$options = [\\n  'client_id' => $clientId,\\n  'client_secret' => $clientSecret,\\n  'sandbox' => true\\n];\\n \\nfunction createCharge() {\\n  $item1 = [\\n    'name' => 'Item 1',\\n    'amount' => 1,\\n    'value' => 1000\\n  ];\\n \\n  $item2 = [\\n    'name' => 'Item 2'\\n    'amount' => 2,\\n    'value' => 2000\\n  ];\\n \\n  $items = [\\n    $item1,\\n    $item2\\n  ];\\n \\n  $body = [\\n    'items' => $items\\n  ];\\n \\n  $api = new Gerencianet($options);\\n  $charge = $api->createCharge([], $body);\\n  return $charge;\\n}\\n \\nfunction pay($charge) {\\n  $customer = [\\n    'name' => 'Gorbadoc Oldbuck',\\n    'cpf' => '94271564656' ,\\n    'phone_number' => '5144916523'\\n  ];\\n \\n  $bankingBillet = [\\n    'expire_at' => '2018-12-12',\\n    'customer' => $customer\\n  ];\\n \\n  $payment = [\\n    'banking_billet' => $bankingBillet\\n  ];\\n \\n  $body = [\\n    'payment' => $payment\\n  ];\\n \\n  $params = [\\n    'id' => $charge['data']['charge_id'];\\n  ];\\n \\n  $api = new Gerencianet($options);\\n  $payment = $api->payCharge($params, $body);\\n \\n  return $payment;\\n}\\n \\n \\ntry {\\n  $charge = createCharge();\\n  $payment = pay($charge);\\n \\n  print_r($payment);\\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      \"language\": \"text\",\n      \"name\": \"PHP\"\n    },\n    {\n      \"code\": \"'use strict';\\n \\nvar Gerencianet = require('gn-api-sdk-node');\\n \\nvar clientId = 'your_client_id';\\nvar clientSecret = 'your_client_secret';\\nvar body, params;\\n \\nvar options = {\\n  client_id: clientId,\\n  client_secret: clientSecret,\\n  sandbox: true\\n}\\n \\nvar gerencianet = new Gerencianet(options);\\n \\nfunction createCharge() {\\n  body = {\\n    items: [{\\n      name: 'Product 1',\\n      value: 1000,\\n      amount: 2\\n    }]\\n  }\\n \\n  return gerencianet\\n    .createCharge({}, body);\\n}\\n \\nfunction pay(charge) {\\n  body = {\\n    payment: {\\n      banking_billet: {\\n        expire_at: '2018-12-12',\\n        customer: {\\n          name: 'Gorbadoc Oldbuck',\\n          cpf: '94271564656',\\n          phone_number: '5144916523'\\n        }\\n      }\\n    }\\n  }\\n \\n  params = {\\n    id: charge.data.id\\n  }\\n \\n  return gerencianet\\n    .payCharge(params, body);\\n}\\n \\ncreateCharge()\\n  .then(pay)\\n  .then(console.log)\\n  .catch(console.log)\\n  .done();\",\n      \"language\": \"javascript\",\n      \"name\": \"NodeJS\"\n    },\n    {\n      \"code\": \"require \\\"gerencianet\\\"\\n \\noptions = {\\n  client_id: \\\"client_id\\\",\\n  client_secret: \\\"client_secret\\\",\\n  sandbox: true\\n}\\n \\ncharge = {\\n  items: [{\\n    name: \\\"Product 1\\\",\\n    value: 1000,\\n    amount: 2\\n  }],\\n  shippings: [{\\n    name: \\\"Default Shipping Cost\\\",\\n    value: 100\\n  }, {\\n    name: \\\"Adicional Shipping Cost\\\",\\n    value: 150\\n  }]\\n}\\n \\npayment = {\\n  payment: {\\n    credit_card: {\\n      installments: 1,\\n      payment_token: \\\"6426f3abd8688639c6772963669bbb8e0eb3c319\\\",\\n      billing_address: {\\n        street: \\\"Av. JK\\\",\\n        number: 909,\\n        neighborhood: \\\"Bauxita\\\",\\n        zipcode: \\\"35400000\\\",\\n        city: \\\"Ouro Preto\\\",\\n        state: \\\"MG\\\"\\n      },\\n      customer: {\\n        name: \\\"Gorbadoc Oldbuck\\\",\\n        email: \\\"oldbuck:::at:::gerencianet.com.br\\\",\\n        cpf: \\\"94271564656\\\",\\n        birth: \\\"1977-01-15\\\",\\n        phone_number: \\\"5144916523\\\"\\n      }\\n    }\\n  }\\n}\\n \\ngerencianet = Gerencianet.new(options)\\n \\ncharge = gerencianet.create_charge(body: charge)\\n \\nparams = {\\n  id: charge[\\\"data\\\"][\\\"charge_id\\\"]\\n}\\n \\ngerencianet.pay_charge(params: params, body: payment)\",\n      \"language\": \"ruby\",\n      \"name\": \"Ruby\"\n    },\n    {\n      \"code\": \"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\\t'items': [{\\n\\t\\t'name': \\\"Product 1\\\",\\n\\t\\t'value': 1000,\\n\\t\\t'amount': 2\\n\\t}],\\n\\t'shippings': [{\\n\\t\\t'name': \\\"Default Shipping Cost\\\",\\n\\t\\t'value': 100\\n\\t}, {\\n\\t\\t'name': \\\"Adicional Shipping Cost\\\",\\n\\t\\t'value': 150\\n\\t}]\\n}\\n \\ncharge = gn.create_charge(body=body)\\n \\nparams = {\\n\\t'id': charge['data']['charge_id']\\n}\\n \\nbody = {\\n\\t'payment': {\\n\\t    'credit_card': {\\n\\t    \\t'installments': 1,\\n\\t    \\t'payment_token': \\\"6426f3abd8688639c6772963669bbb8e0eb3c319\\\",\\n\\t    \\t'billing_address': {\\n\\t\\t\\t\\t'street': \\\"Av. JK\\\",\\n\\t\\t\\t\\t'number': 909,\\n\\t\\t\\t\\t'neighborhood': \\\"Bauxita\\\",\\n\\t\\t\\t\\t'zipcode': \\\"35400000\\\",\\n\\t\\t\\t\\t'city': \\\"Ouro Preto\\\",\\n\\t\\t\\t\\t'state': \\\"MG\\\"\\n\\t     \\t},\\n\\t     \\t'customer': {\\n\\t\\t\\t\\t'name': \\\"Gorbadoc Oldbuck\\\",\\n\\t\\t\\t\\t'email': \\\"oldbuck@gerencianet.com.br\\\",\\n\\t\\t\\t\\t'cpf': \\\"94271564656\\\",\\n\\t\\t\\t\\t'birth': \\\"1977-01-15\\\",\\n\\t\\t\\t\\t'phone_number': \\\"5144916523\\\"\\n\\t     \\t}\\n\\t    }\\n  \\t}\\t\\n}\\n \\ngn.pay_charge(params=params, body=body)\",\n      \"language\": \"python\",\n      \"name\": \"Python\"\n    },\n    {\n      \"code\": \"dynamic endpoints = new Endpoints(\\\"client_id\\\", \\\"client_secret\\\", true);\\n \\nvar body = new\\n{\\n    items = new[] {\\n        new {\\n            name = \\\"Product 1\\\",\\n            value = 1000,\\n            amount = 2\\n        }\\n    },\\n    shippings = new[] {\\n        new {\\n            name = \\\"Default Shipping Cost\\\",\\n            value = 100\\n        }\\n    }\\n};\\n \\nvar response = endpoints.CreateCharge(null, body);\\n \\nvar params = new {\\n    id = response.data.charge_id\\n};\\n \\nvar body = new {\\n    payment = new {\\n        credit_card = new {\\n            installments = 1,\\n            payment_token = \\\"6426f3abd8688639c6772963669bbb8e0eb3c319\\\",\\n            billing_address = new {\\n                street = \\\"Av. JK\\\",\\n                number = 909,\\n                neighborhood = \\\"Bauxita\\\",\\n                zipcode = \\\"35400000\\\",\\n                city = \\\"Ouro Preto\\\",\\n                state = \\\"MG\\\"\\n            },\\n            customer = new {\\n                name = \\\"Gorbadoc Oldbuck\\\",\\n                email = \\\"oldbuck@gerencianet.com.br\\\",\\n                cpf = \\\"94271564656\\\",\\n                birth = \\\"1977-01-15\\\",\\n                phone_number = \\\"5144916523\\\"\\n            }\\n        }\\n    }\\n};\\n \\nvar response = endpoints.PayCharge(params, body);\",\n      \"language\": \"asp\",\n      \"name\": \".NET\"\n    },\n    {\n      \"code\": \"package br.com.gerencianet.lightbox;\\n\\nimport java.util.ArrayList;\\nimport java.util.HashMap;\\nimport java.util.List;\\nimport java.util.Map;\\nimport br.com.gerencianet.Credentials;\\nimport br.com.gerencianet.gnsdk.Gerencianet;\\n\\npublic class CheckoutLightbox {\\n\\tprivate String chargeId;\\n\\tprivate Gerencianet gn;\\n\\t\\n\\tpublic CheckoutLightbox() throws Exception\\n\\t{\\n\\t\\t/* *********  Set credentials parameters ******** */\\n\\n\\t\\tCredentials credentials = new Credentials();\\n\\n\\t\\tHashMap<String, Object> options = new HashMap<String, Object>();\\n\\t\\toptions.put(\\\"client_id\\\", credentials.getClientId());\\n\\t\\toptions.put(\\\"client_secret\\\", credentials.getClientSecret());\\n\\t\\toptions.put(\\\"sandbox\\\", credentials.isSandbox());\\n\\n\\t\\t/* ************************************************* */ \\n\\t\\t\\n\\t\\tthis.gn = new Gerencianet(options);\\n\\t}\\n\\t\\n\\tpublic void createCharge() throws Exception{\\n\\n\\t\\tList<Object> items = new ArrayList<Object>();\\n\\n\\t\\tMap<String, Object> item1 = new HashMap<String, Object>();\\n\\t\\titem1.put(\\\"name\\\", \\\"Item 1\\\");\\n\\t\\titem1.put(\\\"amount\\\", 1);\\n\\t\\titem1.put(\\\"value\\\", 1000);\\n\\n\\t\\tMap<String, Object> item2 = new HashMap<String, Object>();\\n\\t\\titem2.put(\\\"name\\\", \\\"Item 2\\\");\\n\\t\\titem2.put(\\\"amount\\\", 1);\\n\\t\\titem2.put(\\\"value\\\", 2000);\\n\\n\\t\\titems.add(item1);\\n\\t\\titems.add(item2);\\n\\t\\t\\n\\t\\tMap<String, Object> body = new HashMap<String, Object>();\\n\\t\\tbody.put(\\\"items\\\", items);\\n\\t\\t\\n\\t\\tMap<String, Object> response = gn.call(\\\"createCharge\\\", new HashMap<String,String>(), body);\\n\\t\\t@SuppressWarnings(\\\"unchecked\\\")\\n\\t\\tHashMap<String, Object> data = (HashMap<String, Object>) response.get(\\\"data\\\");\\n\\t\\tthis.chargeId = data.get(\\\"charge_id\\\").toString();\\n\\t}\\n\\t\\n\\tpublic Map<String, Object> payCharge() throws Exception{\\n\\t\\tHashMap<String, String> params = new HashMap<String, String>();\\n\\t\\tparams.put(\\\"id\\\", this.chargeId);\\n\\n\\t\\tMap<String, Object> customer = new HashMap<String, Object>();\\n\\t\\tcustomer.put(\\\"name\\\", \\\"Gorbadoc Oldbuck\\\");\\n\\t\\tcustomer.put(\\\"cpf\\\", \\\"04267484171\\\");\\n\\t\\tcustomer.put(\\\"phone_number\\\", \\\"5144916523\\\");\\n\\n\\t\\tMap<String, Object> bankingBillet = new HashMap<String, Object>();\\n\\t\\tbankingBillet.put(\\\"expire_at\\\", \\\"2018-12-12\\\");\\n\\t\\tbankingBillet.put(\\\"customer\\\", customer);\\n\\n\\t\\tMap<String, Object> payment = new HashMap<String, Object>();\\n\\t\\tpayment.put(\\\"banking_billet\\\", bankingBillet);\\n\\n\\t\\tMap<String, Object> body = new HashMap<String, Object>();\\n\\t\\tbody.put(\\\"payment\\\", payment);\\n\\n\\t\\tMap<String, Object> response = gn.call(\\\"payCharge\\\", params, body);\\n\\t\\treturn response;\\n\\t}\\n}\\n\\n\\n// in another file\\n\\npublic class LightboxTest {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\ttry {\\n\\t\\t\\tCheckoutLightbox clb = new CheckoutLightbox();\\n\\t\\t\\tclb.createCharge();\\n\\t\\t\\tMap<String, Object> response = clb.payCharge();\\n\\t\\t    System.out.println(response);\\n\\t\\t}catch (GerencianetException e){\\n\\t\\t    System.out.println(e.getCode());\\n\\t\\t    System.out.println(e.getError());\\n\\t\\t    System.out.println(e.getErrorDescription());\\n\\t\\t}\\n\\t\\tcatch (Exception e) {\\n\\t\\t    System.out.println(e.getMessage());\\n\\t\\t}\\n\\t}\\n}\\n\\n\\n// Mais detalhes via GitHUb: https://github.com/gerencianet/gn-api-sdk-java-examples/tree/master/src/main/java/br/com/gerencianet/lightbox\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"interface\\nfunction CreateCharge: String;\\nfunction Checkout: String\\n\\nimplementation\\nuses\\n  uGerenciaNetClientUtilities, uGerenciaClient;\\n\\n\\nfunction CreateCharge: String;\\nvar \\nBody :  String;\\n\\nbegin  \\n  EnableService( 'GerenciaNet.dll' ); \\n  ConfigureService( ToPAnsiChar( 'client_id' ),ToPAnsiChar( 'client_secret' ),'sandbox','config.json',''); \\n  GerenciaNetAuthorize(); \\n\\n  Body := \\n  '{'+\\n    '\\\"items\\\":'+\\n      '['+\\n        '{'+\\n          '\\\"name\\\":\\\"test article\\\",'+\\n          '\\\"value\\\":1900,'+\\n          '\\\"amount\\\":2'+\\n        '},'+\\n        '{'+\\n          '\\\"name\\\":\\\"test article 2\\\",'+\\n          '\\\"value\\\":3000,'+\\n          '\\\"amount\\\":1'+\\n        '}'+\\n      ']'+\\n  '}';\\n\\n  EnableService( 'GerenciaNet.dll' ); \\n  ConfigureService( ToPAnsiChar( 'client_id' ),ToPAnsiChar( 'client_secret' ),'sandbox','config.json',''); \\n  GerenciaNetAuthorize();\\n\\n  Result := ExecuteGerenciaNetRequest( 'createCharge','','',Body );\\nend;\\n\\n{ ...Nesta função foi usada a biblioteca X-Superobject para manipulação de objetos JSON. Pode ser que em algumas versões do Delphi esta biblioteca não seja funcional... }\\nfunction Checkout: String;\\nvar Response : String;\\n    Body : String;\\n    PaymentParams: String;\\n    ChargeJsonObject : ISuperObject;\\n    Charge : String;\\n    ChargeId : String;\\nbegin\\n  Charge := CreateCharge();\\n  ChargeJsonObject := SO(Charge);\\n  ChargeId := ChargeJsonObject['data.\\\"charge_id\\\"'].AsString;\\n\\n  PaymentParams := CreateRequestParams( [ 'id='+ChargeId ] ).Text;\\n\\n  Body := '{'+\\n    '\\\"payment\\\": {'+\\n      '\\\"banking_billet\\\": {'+\\n        '\\\"customer\\\": {'+\\n          '\\\"email\\\": \\\"email_do_cliente@servidor.com.br\\\",'+\\n          '\\\"phone_number\\\": \\\"5144916523\\\",'+\\n          '\\\"birth\\\": \\\"1977-07-17\\\",'+\\n          '\\\"address\\\": {'+\\n            '\\\"street\\\": \\\"Av. JK\\\",'+\\n            '\\\"number\\\": 909,'+\\n            '\\\"neighborhood\\\": \\\"Bauxita\\\",'+\\n            '\\\"complement\\\": \\\"\\\",'+\\n            '\\\"city\\\": \\\"Ouro Preto\\\",'+\\n            '\\\"state\\\": \\\"MG\\\",'+\\n            '\\\"zipcode\\\": \\\"35400000\\\"'+\\n          '},'+\\n          '\\\"name\\\": \\\"Gorbadoc Oldbuck\\\",'+\\n          '\\\"cpf\\\": \\\"94271564656\\\"'+\\n        '},'+\\n        '\\\"message\\\": \\\"Test\\\",'+\\n        '\\\"expire_at\\\": \\\"2019-02-21\\\"'+\\n      '}'+\\n    '}'+\\n  '}';\\n\\n  Result := ExecuteGerenciaNetRequest( 'payCharge',PaymentParams,'',Body ) ;\\nend;\",\n      \"language\": \"json\",\n      \"name\": \"Delphi\"\n    }\n  ]\n}\n[/block]\n## Download do exemplo\n\nPara fazer o download do exemplo de implementação do lightbox, <a href=\"https://github.com/gerencianet/gn-lightbox-example\" target=\"_blank\">clique aqui</a>.","excerpt":"Você está em: *\"Checkout via Ligthbox > Utilizando Ligthbox\"*","slug":"checkout-ligthbox","type":"basic","title":"Utilizando Ligthbox"}

Utilizando Ligthbox

Você está em: *"Checkout via Ligthbox > Utilizando Ligthbox"*

O checkout via lightbox é o tipo de integração da Gerencianet em que não há necessidade de o integrador ter uma tela de pagamento. Sua tela de pagamento será o lightbox. Apesar de ser um facilitador, o lightbox requer que a integração no backend seja realizada normalmente. Para prosseguir com a execução dos códigos a seguir, [certifique-se que a SDK da Gerencianet foi instalada](https://dev.gerencianet.com.br/docs#section-bibliotecas). ## Adicionando o lightbox em sua página Primeiramente, será necessário adicionar um script em sua página que disponibiliza as funções necessárias à construção e funcionamento do lightbox. [block:html] { "html": "<p>Para gerar o código Javascript específico de sua conta Gerencianet, insira no campo abaixo o seu \"identificador da conta\" (<a target=\"blank\" href=\"http://image.prntscr.com/image/cabe13e1e5b64449b942cf31139150ba.png\" class=\"block-display-image-parent block-display-image-size-smart\"><img>onde localizo?</img></a>) e clique no botão \"Gerar\". Cabe frisar que é preciso estar logado em sua conta Gerencianet para visualizar o identificador de sua conta.</p>\n\n<input id=\"input_code_ck\" type=\"text\" > <button id=\"get_code_ck\">Gerar</button> \n<div id=\"resultado_code_js_ck\"></div>" } [/block] Após a inserção do script, as seguintes funções ficarão disponíveis: - <code>ready()</code> - <code>lightbox()</code> - <code>show()</code> ### $gn.ready ( callback ) [block:parameters] { "data": { "h-0": "Parâmetros", "h-1": "Tipo", "h-2": "Descrição", "0-0": "callback<span class=\"obrigatorio\">*</span>", "0-1": "Function", "0-2": "Função de inicialização que possibilita a chamada das demais funções.\n\n<span class=\"tab1\"><em>Parâmetro(s) de callback</em><div>\n\n<div class=\"tab2\"><code>object <span class=\"obrigatorio\">*</span></code></span>, Objeto que recebe as instâncias das outras funções.</div>" }, "cols": 3, "rows": 1 } [/block] <strong class="atributo-obrigatorio-texto">* valor obrigatório</strong> ### lightbox ( available_payment_forms ) [block:parameters] { "data": { "h-0": "Parâmetros", "h-1": "Tipo", "h-2": "Descrição", "0-0": "available_payment_forms<span class=\"obrigatorio\">*</span>", "0-1": "Array", "0-2": "Array com a(s) forma(s) de pagamento que o lightbox contemplará.\n\nAs opções disponíveis são:\n- banking_billet (boleto bancário);\n- credit_card (cartão de crédito)." }, "cols": 3, "rows": 1 } [/block] <strong class="atributo-obrigatorio-texto">* valor obrigatório</strong> ### show ( data ) [block:parameters] { "data": { "h-0": "Parâmetros", "0-0": "data<strong class=\"atributo-obrigatorio\">*</strong>", "h-1": "Tipo", "h-2": "Descrição", "0-1": "Object", "0-2": "Objeto com as informações essencias para a construção do lightbox. Os atributos são:\n\n<div class=\"tab2\"><code>items<span class=\"obrigatorio\">*</span></code>, Array com os items que serão adquiridos pelo cliente. Cada instância deste array será um objeto que deverá ter, obrigatoriamente, name e value (<strong class=\"atributo\">valor inteiro, ex.: R$ 123,00 = 12300</strong>). As instâncias também poderão ter amount, cujo valor padrão é 1.</div>\n\n<div class=\"tab2\">\n<code>actionForm<span class=\"obrigatorio\">*</span></code>, URL do backend para onde serão enviadas as informações coletadas do cliente.</div>\n\n<div class=\"tab2\"><code>shippingCosts</code>, Valor do frete, em inteiro. (<strong class=\"atributo\">R$ 50,00 = 5000</strong>)</div>\n\n<div class=\"tab2\"><code>customer</code>, Boolean que indica se deverá solicitar os dados do cliente (true) ou não (false). O valor padrão é true.</div>\n\n<div class=\"tab2\"> <code>shippingAddress</code>, Boolean que indica se deverá solicitar os dados de endereço de entrega (true) ou não (false). O valor padrão é true.</strong>" }, "cols": 3, "rows": 1 } [/block] <strong class="atributo-obrigatorio-texto">* valor obrigatório</strong> <br /> Com o script adicionado, você deverá chamar a função <code>ready()</code> e, em sua função de callback, chamar a função <code>lightbox()</code> para que a sua página já seja preparada para o lightbox. [block:code] { "codes": [ { "code": "$gn.ready(function(obj) {\n \n var payment_forms = [\"credit_card\", \"banking_billet\"];\n obj.lightbox(payment_forms);\n \n});", "language": "javascript", "name": " " } ] } [/block] <br /> Outra alteração necessária é no botão que abrirá o lightbox, onde você deverá adicionar o atributo <code>rel="gn_lightbox"</code> e a função <code>show()</code> para o click no botão. [block:code] { "codes": [ { "code": "<!DOCTYPE html>\n <head>\n <script>\n $gn.ready(function(obj){\n \n ...\n \n obj.jq('#button_lightbox').click(function(evt) {\n \n var data = {\n items: [\n {\n name: 'Item 1', // nome do item, produto ou serviço\n value: 12000 // valor (12000 = R$ 120,00)\n },\n {\n name: 'Item 2', // nome do item, produto ou serviço\n value: 4000, // valor (4000 = R$ 40,00)\n amount: 1 // quantidade\n }\n ],\n shippingCosts: 3560,\n actionForm: 'http://your_domain/your_backend_url'\n };\n \n obj.show(data);\n \n });\n \n });\n </script>\n </head>\n \n <body>\n <button rel=\"gn_lightbox\" id='button_lightbox'>\n Open Lightbox\n </button>\n </body>\n</html>", "language": "html", "name": " " } ] } [/block] Com estas implementações, o lightbox já poderá ser aberto em sua página, porém ainda será necessário realizar a integração no backend para que ele tenha um funcionamento correto. ## Realizando a integração O lightbox funciona como uma tela de pagamento para seu site ou aplicação. Quando o comprador preencher os campos e realizar o pagamento no lightbox, um POST será enviado para a URL informada no parâmetro *actionForm*, contendo os dados para a finalização da compra. Para a concretização do pagamento, o programador deverá fazer a integração detalhada no menu <a href="https://docs.gerencianet.com.br/transacoes/introducao" target="_blank">Transações</a>. A resposta desta URL deve ser o conteúdo retornado no webservice de pagamento de transação (/payment/pay) no formato JSON para que o lightbox possa avaliá-la e exibir a tela de sucesso ou de erro para o comprador. [block:code] { "codes": [ { "code": "<?php\n \nrequire __DIR__.'/../../vendor/autoload.php'; // caminho relacionado a SDK\n \nuse Gerencianet\\Exception\\GerencianetException;\nuse Gerencianet\\Gerencianet;\n \n$clientId = 'your_client_id';\n$clientSecret = 'your_client_secret';\n \n$options = [\n 'client_id' => $clientId,\n 'client_secret' => $clientSecret,\n 'sandbox' => true\n];\n \nfunction createCharge() {\n $item1 = [\n 'name' => 'Item 1',\n 'amount' => 1,\n 'value' => 1000\n ];\n \n $item2 = [\n 'name' => 'Item 2'\n 'amount' => 2,\n 'value' => 2000\n ];\n \n $items = [\n $item1,\n $item2\n ];\n \n $body = [\n 'items' => $items\n ];\n \n $api = new Gerencianet($options);\n $charge = $api->createCharge([], $body);\n return $charge;\n}\n \nfunction pay($charge) {\n $customer = [\n 'name' => 'Gorbadoc Oldbuck',\n 'cpf' => '94271564656' ,\n 'phone_number' => '5144916523'\n ];\n \n $bankingBillet = [\n 'expire_at' => '2018-12-12',\n 'customer' => $customer\n ];\n \n $payment = [\n 'banking_billet' => $bankingBillet\n ];\n \n $body = [\n 'payment' => $payment\n ];\n \n $params = [\n 'id' => $charge['data']['charge_id'];\n ];\n \n $api = new Gerencianet($options);\n $payment = $api->payCharge($params, $body);\n \n return $payment;\n}\n \n \ntry {\n $charge = createCharge();\n $payment = pay($charge);\n \n print_r($payment);\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}", "language": "text", "name": "PHP" }, { "code": "'use strict';\n \nvar Gerencianet = require('gn-api-sdk-node');\n \nvar clientId = 'your_client_id';\nvar clientSecret = 'your_client_secret';\nvar body, params;\n \nvar options = {\n client_id: clientId,\n client_secret: clientSecret,\n sandbox: true\n}\n \nvar gerencianet = new Gerencianet(options);\n \nfunction createCharge() {\n body = {\n items: [{\n name: 'Product 1',\n value: 1000,\n amount: 2\n }]\n }\n \n return gerencianet\n .createCharge({}, body);\n}\n \nfunction pay(charge) {\n body = {\n payment: {\n banking_billet: {\n expire_at: '2018-12-12',\n customer: {\n name: 'Gorbadoc Oldbuck',\n cpf: '94271564656',\n phone_number: '5144916523'\n }\n }\n }\n }\n \n params = {\n id: charge.data.id\n }\n \n return gerencianet\n .payCharge(params, body);\n}\n \ncreateCharge()\n .then(pay)\n .then(console.log)\n .catch(console.log)\n .done();", "language": "javascript", "name": "NodeJS" }, { "code": "require \"gerencianet\"\n \noptions = {\n client_id: \"client_id\",\n client_secret: \"client_secret\",\n sandbox: true\n}\n \ncharge = {\n items: [{\n name: \"Product 1\",\n value: 1000,\n amount: 2\n }],\n shippings: [{\n name: \"Default Shipping Cost\",\n value: 100\n }, {\n name: \"Adicional Shipping Cost\",\n value: 150\n }]\n}\n \npayment = {\n payment: {\n credit_card: {\n installments: 1,\n payment_token: \"6426f3abd8688639c6772963669bbb8e0eb3c319\",\n billing_address: {\n street: \"Av. JK\",\n number: 909,\n neighborhood: \"Bauxita\",\n zipcode: \"35400000\",\n city: \"Ouro Preto\",\n state: \"MG\"\n },\n customer: {\n name: \"Gorbadoc Oldbuck\",\n email: \"oldbuck@gerencianet.com.br\",\n cpf: \"94271564656\",\n birth: \"1977-01-15\",\n phone_number: \"5144916523\"\n }\n }\n }\n}\n \ngerencianet = Gerencianet.new(options)\n \ncharge = gerencianet.create_charge(body: charge)\n \nparams = {\n id: charge[\"data\"][\"charge_id\"]\n}\n \ngerencianet.pay_charge(params: params, body: payment)", "language": "ruby", "name": "Ruby" }, { "code": "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\t'items': [{\n\t\t'name': \"Product 1\",\n\t\t'value': 1000,\n\t\t'amount': 2\n\t}],\n\t'shippings': [{\n\t\t'name': \"Default Shipping Cost\",\n\t\t'value': 100\n\t}, {\n\t\t'name': \"Adicional Shipping Cost\",\n\t\t'value': 150\n\t}]\n}\n \ncharge = gn.create_charge(body=body)\n \nparams = {\n\t'id': charge['data']['charge_id']\n}\n \nbody = {\n\t'payment': {\n\t 'credit_card': {\n\t \t'installments': 1,\n\t \t'payment_token': \"6426f3abd8688639c6772963669bbb8e0eb3c319\",\n\t \t'billing_address': {\n\t\t\t\t'street': \"Av. JK\",\n\t\t\t\t'number': 909,\n\t\t\t\t'neighborhood': \"Bauxita\",\n\t\t\t\t'zipcode': \"35400000\",\n\t\t\t\t'city': \"Ouro Preto\",\n\t\t\t\t'state': \"MG\"\n\t \t},\n\t \t'customer': {\n\t\t\t\t'name': \"Gorbadoc Oldbuck\",\n\t\t\t\t'email': \"oldbuck@gerencianet.com.br\",\n\t\t\t\t'cpf': \"94271564656\",\n\t\t\t\t'birth': \"1977-01-15\",\n\t\t\t\t'phone_number': \"5144916523\"\n\t \t}\n\t }\n \t}\t\n}\n \ngn.pay_charge(params=params, body=body)", "language": "python", "name": "Python" }, { "code": "dynamic endpoints = new Endpoints(\"client_id\", \"client_secret\", true);\n \nvar body = new\n{\n items = new[] {\n new {\n name = \"Product 1\",\n value = 1000,\n amount = 2\n }\n },\n shippings = new[] {\n new {\n name = \"Default Shipping Cost\",\n value = 100\n }\n }\n};\n \nvar response = endpoints.CreateCharge(null, body);\n \nvar params = new {\n id = response.data.charge_id\n};\n \nvar body = new {\n payment = new {\n credit_card = new {\n installments = 1,\n payment_token = \"6426f3abd8688639c6772963669bbb8e0eb3c319\",\n billing_address = new {\n street = \"Av. JK\",\n number = 909,\n neighborhood = \"Bauxita\",\n zipcode = \"35400000\",\n city = \"Ouro Preto\",\n state = \"MG\"\n },\n customer = new {\n name = \"Gorbadoc Oldbuck\",\n email = \"oldbuck@gerencianet.com.br\",\n cpf = \"94271564656\",\n birth = \"1977-01-15\",\n phone_number = \"5144916523\"\n }\n }\n }\n};\n \nvar response = endpoints.PayCharge(params, body);", "language": "asp", "name": ".NET" }, { "code": "package br.com.gerencianet.lightbox;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport br.com.gerencianet.Credentials;\nimport br.com.gerencianet.gnsdk.Gerencianet;\n\npublic class CheckoutLightbox {\n\tprivate String chargeId;\n\tprivate Gerencianet gn;\n\t\n\tpublic CheckoutLightbox() throws Exception\n\t{\n\t\t/* ********* Set credentials parameters ******** */\n\n\t\tCredentials credentials = new Credentials();\n\n\t\tHashMap<String, Object> options = new HashMap<String, Object>();\n\t\toptions.put(\"client_id\", credentials.getClientId());\n\t\toptions.put(\"client_secret\", credentials.getClientSecret());\n\t\toptions.put(\"sandbox\", credentials.isSandbox());\n\n\t\t/* ************************************************* */ \n\t\t\n\t\tthis.gn = new Gerencianet(options);\n\t}\n\t\n\tpublic void createCharge() throws Exception{\n\n\t\tList<Object> items = new ArrayList<Object>();\n\n\t\tMap<String, Object> item1 = new HashMap<String, Object>();\n\t\titem1.put(\"name\", \"Item 1\");\n\t\titem1.put(\"amount\", 1);\n\t\titem1.put(\"value\", 1000);\n\n\t\tMap<String, Object> item2 = new HashMap<String, Object>();\n\t\titem2.put(\"name\", \"Item 2\");\n\t\titem2.put(\"amount\", 1);\n\t\titem2.put(\"value\", 2000);\n\n\t\titems.add(item1);\n\t\titems.add(item2);\n\t\t\n\t\tMap<String, Object> body = new HashMap<String, Object>();\n\t\tbody.put(\"items\", items);\n\t\t\n\t\tMap<String, Object> response = gn.call(\"createCharge\", new HashMap<String,String>(), body);\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tHashMap<String, Object> data = (HashMap<String, Object>) response.get(\"data\");\n\t\tthis.chargeId = data.get(\"charge_id\").toString();\n\t}\n\t\n\tpublic Map<String, Object> payCharge() throws Exception{\n\t\tHashMap<String, String> params = new HashMap<String, String>();\n\t\tparams.put(\"id\", this.chargeId);\n\n\t\tMap<String, Object> customer = new HashMap<String, Object>();\n\t\tcustomer.put(\"name\", \"Gorbadoc Oldbuck\");\n\t\tcustomer.put(\"cpf\", \"04267484171\");\n\t\tcustomer.put(\"phone_number\", \"5144916523\");\n\n\t\tMap<String, Object> bankingBillet = new HashMap<String, Object>();\n\t\tbankingBillet.put(\"expire_at\", \"2018-12-12\");\n\t\tbankingBillet.put(\"customer\", customer);\n\n\t\tMap<String, Object> payment = new HashMap<String, Object>();\n\t\tpayment.put(\"banking_billet\", bankingBillet);\n\n\t\tMap<String, Object> body = new HashMap<String, Object>();\n\t\tbody.put(\"payment\", payment);\n\n\t\tMap<String, Object> response = gn.call(\"payCharge\", params, body);\n\t\treturn response;\n\t}\n}\n\n\n// in another file\n\npublic class LightboxTest {\n\n\tpublic static void main(String[] args) {\n\t\ttry {\n\t\t\tCheckoutLightbox clb = new CheckoutLightbox();\n\t\t\tclb.createCharge();\n\t\t\tMap<String, Object> response = clb.payCharge();\n\t\t System.out.println(response);\n\t\t}catch (GerencianetException e){\n\t\t System.out.println(e.getCode());\n\t\t System.out.println(e.getError());\n\t\t System.out.println(e.getErrorDescription());\n\t\t}\n\t\tcatch (Exception e) {\n\t\t System.out.println(e.getMessage());\n\t\t}\n\t}\n}\n\n\n// Mais detalhes via GitHUb: https://github.com/gerencianet/gn-api-sdk-java-examples/tree/master/src/main/java/br/com/gerencianet/lightbox", "language": "java" }, { "code": "interface\nfunction CreateCharge: String;\nfunction Checkout: String\n\nimplementation\nuses\n uGerenciaNetClientUtilities, uGerenciaClient;\n\n\nfunction CreateCharge: String;\nvar \nBody : String;\n\nbegin \n EnableService( 'GerenciaNet.dll' ); \n ConfigureService( ToPAnsiChar( 'client_id' ),ToPAnsiChar( 'client_secret' ),'sandbox','config.json',''); \n GerenciaNetAuthorize(); \n\n Body := \n '{'+\n '\"items\":'+\n '['+\n '{'+\n '\"name\":\"test article\",'+\n '\"value\":1900,'+\n '\"amount\":2'+\n '},'+\n '{'+\n '\"name\":\"test article 2\",'+\n '\"value\":3000,'+\n '\"amount\":1'+\n '}'+\n ']'+\n '}';\n\n EnableService( 'GerenciaNet.dll' ); \n ConfigureService( ToPAnsiChar( 'client_id' ),ToPAnsiChar( 'client_secret' ),'sandbox','config.json',''); \n GerenciaNetAuthorize();\n\n Result := ExecuteGerenciaNetRequest( 'createCharge','','',Body );\nend;\n\n{ ...Nesta função foi usada a biblioteca X-Superobject para manipulação de objetos JSON. Pode ser que em algumas versões do Delphi esta biblioteca não seja funcional... }\nfunction Checkout: String;\nvar Response : String;\n Body : String;\n PaymentParams: String;\n ChargeJsonObject : ISuperObject;\n Charge : String;\n ChargeId : String;\nbegin\n Charge := CreateCharge();\n ChargeJsonObject := SO(Charge);\n ChargeId := ChargeJsonObject['data.\"charge_id\"'].AsString;\n\n PaymentParams := CreateRequestParams( [ 'id='+ChargeId ] ).Text;\n\n Body := '{'+\n '\"payment\": {'+\n '\"banking_billet\": {'+\n '\"customer\": {'+\n '\"email\": \"email_do_cliente@servidor.com.br\",'+\n '\"phone_number\": \"5144916523\",'+\n '\"birth\": \"1977-07-17\",'+\n '\"address\": {'+\n '\"street\": \"Av. JK\",'+\n '\"number\": 909,'+\n '\"neighborhood\": \"Bauxita\",'+\n '\"complement\": \"\",'+\n '\"city\": \"Ouro Preto\",'+\n '\"state\": \"MG\",'+\n '\"zipcode\": \"35400000\"'+\n '},'+\n '\"name\": \"Gorbadoc Oldbuck\",'+\n '\"cpf\": \"94271564656\"'+\n '},'+\n '\"message\": \"Test\",'+\n '\"expire_at\": \"2019-02-21\"'+\n '}'+\n '}'+\n '}';\n\n Result := ExecuteGerenciaNetRequest( 'payCharge',PaymentParams,'',Body ) ;\nend;", "language": "json", "name": "Delphi" } ] } [/block] ## Download do exemplo Para fazer o download do exemplo de implementação do lightbox, <a href="https://github.com/gerencianet/gn-lightbox-example" target="_blank">clique aqui</a>.