{"id":841324,"date":"2026-09-09T12:21:13","date_gmt":"2026-09-09T12:21:13","guid":{"rendered":"https:\/\/www.knowband.com\/blog\/?p=841317\/"},"modified":"2026-09-15T06:36:01","modified_gmt":"2026-09-15T06:36:01","slug":"prestashop-payment-gateway-integration","status":"publish","type":"post","link":"https:\/\/www.knowband.com\/blog\/pt-br\/ecommerce-blog\/prestashop-payment-gateway-integration\/","title":{"rendered":"Integra\u00e7\u00e3o de um gateway de pagamento personalizado no PrestaShop: Requisitos t\u00e9cnicos, fluxo da API e desafios reais do OPC"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Integrar um gateway de pagamento ao PrestaShop pode parecer simples no papel.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">O gateway fornece documenta\u00e7\u00e3o da API, credenciais de sandbox, chaves de autentica\u00e7\u00e3o, URLs de retorno de chamada e alguns endpoints. O m\u00f3dulo PrestaShop ent\u00e3o envia a solicita\u00e7\u00e3o de pagamento, recebe a resposta, cria o pedido e redireciona o cliente para a p\u00e1gina de confirma\u00e7\u00e3o.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Numa loja PrestaShop real, por\u00e9m, o sistema de pagamento raramente funciona sozinho.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">No momento em que uma loja utiliza um m\u00f3dulo de finaliza\u00e7\u00e3o de compra em uma \u00fanica p\u00e1gina (OPC), como o SuperCheckout, v\u00e1rios m\u00f3dulos de pagamento, fluxos de pagamento personalizados, iframes, m\u00e9todos de pagamento baseados em JavaScript e outras personaliza\u00e7\u00f5es de finaliza\u00e7\u00e3o de compra podem interagir entre si.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00c9 aqui que muitas integra\u00e7\u00f5es de pagamento se tornam dif\u00edceis.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Durante o trabalho de compatibilidade com gateways de pagamento, encontramos casos em que um m\u00e9todo de pagamento funcionava perfeitamente no checkout padr\u00e3o do PrestaShop, mas se comportava de maneira diferente no OPC. Por exemplo, um provedor de pagamento podia ser exibido corretamente no checkout padr\u00e3o, enquanto op\u00e7\u00f5es como BLIK, sele\u00e7\u00e3o de banco ou BNPL (Buy Now, Pay Later &#8211; Compre Agora, Pague Depois) desapareciam no SuperCheckout.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A li\u00e7\u00e3o importante foi que integrar um gateway de pagamento n\u00e3o se resume apenas a fazer a chamada da API funcionar. Trata-se de garantir que todo o ciclo de pagamento funcione corretamente dentro do checkout do PrestaShop.<\/span><\/p>\n<h2><strong>1.0 O que um gateway de pagamento personalizado realmente precisa?<\/strong><\/h2>\n<p><a href=\"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2026\/09\/Portuguese-2-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-841343 size-full\" src=\"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2026\/09\/Portuguese-2-1.jpg\" alt=\"O que um Gateway de Pagamento Personalizado Realmente Precisa? \" width=\"700\" height=\"700\" srcset=\"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2026\/09\/Portuguese-2-1.jpg 700w, https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2026\/09\/Portuguese-2-1-300x300.jpg 300w, https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2026\/09\/Portuguese-2-1-150x150.jpg 150w, https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2026\/09\/Portuguese-2-1-60x60.jpg 60w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Em linhas gerais, uma integra\u00e7\u00e3o de pagamento no PrestaShop precisa lidar com cinco aspectos:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Exibir o m\u00e9todo de pagamento na finaliza\u00e7\u00e3o da compra.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Enviar os dados do cliente ou de pagamento para o gateway.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Receber e validar a resposta do gateway.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Crie ou atualize o pedido do PrestaShop corretamente.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Redirecione o cliente para a p\u00e1gina de confirma\u00e7\u00e3o ou de erro apropriada.<\/span><\/li>\n<\/ol>\n<p dir=\"ltr\">Um m\u00f3dulo de pagamento t\u00edpico estende a classe base.<\/p>\n<p dir=\"ltr\">O m\u00f3dulo de pagamento normalmente funciona com hooks como:<\/p>\n<p dir=\"ltr\">O gancho \u00e9 respons\u00e1vel por disponibilizar o m\u00e9todo de pagamento para o checkout.<\/p>\n<p dir=\"ltr\">O gancho controla o que o cliente v\u00ea ap\u00f3s retornar do processo de pagamento.<\/p>\n<p><span style=\"font-weight: 400;\">Por exemplo:<\/span><\/p>\n<pre>public function hookPaymentOptions($params) { if (!$this-&gt;active || !$this-&gt;checkCurrency($params['cart'])) { return []; } $paymentOption = new PaymentOption(); $paymentOption -&gt;setCallToActionText($this-&gt;l('Pagar com Cart\u00e3o')) -&gt;setAction( $this-&gt;context-&gt;link-&gt;getModuleLink( $this-&gt;name, 'redirect', [], true ) ); return [$paymentOption]; }<\/pre>\n<p><span style=\"font-weight: 400;\">O ponto importante \u00e9 que esse gancho n\u00e3o deve simplesmente presumir que o m\u00e9todo de pagamento sempre poder\u00e1 ser exibido.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Moeda, pa\u00eds, operadora, estado do cliente, valor do carrinho, configura\u00e7\u00e3o do m\u00f3dulo e disponibilidade do gateway podem influenciar se o m\u00e9todo de pagamento deve ser exibido.<\/span><\/p>\n<h2><strong>2.0 A pe\u00e7a que muda tudo: OPC<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">O checkout padr\u00e3o do PrestaShop e um m\u00f3dulo OPC n\u00e3o processam necessariamente os m\u00e9todos de pagamento exatamente da mesma maneira.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Essa foi uma das li\u00e7\u00f5es mais importantes aprendidas ao trabalhar com v\u00e1rios m\u00f3dulos de pagamento.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Com o checkout padr\u00e3o, um m\u00f3dulo de pagamento geralmente controla a renderiza\u00e7\u00e3o de suas pr\u00f3prias op\u00e7\u00f5es de pagamento e o fluxo de pagamento.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Com um OPC, o m\u00f3dulo de finaliza\u00e7\u00e3o de compra torna-se mais uma camada entre o m\u00f3dulo de pagamento e o cliente. Isso significa que os seguintes elementos podem interagir:<\/span><\/p>\n<pre><b>O cliente<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>OPC \/ SuperCheckout<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Op\u00e7\u00f5es de pagamento<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>M\u00f3dulo de pagamento<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>API de Gateway<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Resposta do gateway<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>M\u00f3dulo de pagamento<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>OPC \/ PrestaShop<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>A confirma\u00e7\u00e3o da ordem<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">Um m\u00f3dulo de pagamento pode, portanto, estar completamente correto do ponto de vista da API e ainda assim n\u00e3o se comportar corretamente dentro de um OPC.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00c9 por isso que os testes de compatibilidade de pagamento devem sempre incluir ambos:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Checkout padr\u00e3o do PrestaShop<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">O OPC real usado pela loja<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Testar apenas o checkout padr\u00e3o pode dar a falsa impress\u00e3o de que a integra\u00e7\u00e3o est\u00e1 completa.<\/span><\/p>\n<h2><strong>3.0 Um exemplo do mundo real: Op\u00e7\u00f5es PayU ausentes dentro do OPC<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Um dos problemas pr\u00e1ticos que encontramos envolveu as op\u00e7\u00f5es de pagamento do PayU.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Na p\u00e1gina de finaliza\u00e7\u00e3o de compra padr\u00e3o do PrestaShop, o PayU conseguiu exibir corretamente os m\u00e9todos de pagamento dispon\u00edveis. No entanto, no SuperCheckout, algumas op\u00e7\u00f5es de pagamento estavam faltando.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Por exemplo, dependendo da configura\u00e7\u00e3o e do carrinho:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">BLIK n\u00e3o estava vis\u00edvel de forma consistente.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">A lista de sele\u00e7\u00e3o de bancos n\u00e3o foi expandida corretamente.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Algumas linhas de BNPL\/pagamento estavam faltando.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Em alguns casos, BLIK aparecia e depois desaparecia.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">\u00c0 primeira vista, parecia ser um problema da API da PayU. Mas n\u00e3o era.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A etapa diagn\u00f3stica importante foi comparar o fluxo de pagamento entre o checkout padr\u00e3o e o SuperCheckout.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Quando o mesmo m\u00f3dulo de pagamento funciona no checkout padr\u00e3o, mas falha no OPC, a investiga\u00e7\u00e3o deve ir al\u00e9m da API do gateway.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Precisamos verificar como o OPC constr\u00f3i os m\u00e9todos de pagamento e quais informa\u00e7\u00f5es ele passa para os m\u00f3dulos de pagamento.<\/span><\/p>\n<h2><strong>4.0 O valor do pagamento pode afetar a visibilidade do m\u00e9todo de pagamento.<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Um aspecto particularmente importante desta investiga\u00e7\u00e3o foi o valor do carrinho de compras. Os sistemas de pagamento geralmente t\u00eam limites m\u00ednimos e m\u00e1ximos para transa\u00e7\u00f5es. Por exemplo:<\/span><\/p>\n<pre><b>Pagamentos<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Confira o valor do carrinho<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Valor m\u00ednimo? Valor m\u00e1ximo?<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Eleg\u00edvel \/ N\u00e3o eleg\u00edvel<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">Durante a investiga\u00e7\u00e3o de compatibilidade com o PayU, rastreamos a l\u00f3gica de filtragem do m\u00e9todo de pagamento at\u00e9 o valor do carrinho sendo passado pelas verifica\u00e7\u00f5es do m\u00e9todo de pagamento.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<p><span style=\"font-weight: 400;\">O fluxo relevante envolvia o c\u00e1lculo do carrinho de compras e a filtragem de m\u00e9todos de pagamento do PrestaShop, incluindo a l\u00f3gica relacionada a:<\/span><\/p>\n<pre>Carrinho::AMBOS<\/pre>\n<p><span style=\"font-weight: 400;\">e:<\/span><\/p>\n<pre><b>PayMethodsCache::checkMinMax<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">Isso \u00e9 importante porque uma op\u00e7\u00e3o de pagamento pode desaparecer do checkout sem que a pr\u00f3pria API retorne um erro.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">O gateway pode simplesmente ser considerado ineleg\u00edvel para o valor recebido pelo m\u00f3dulo de pagamento. Isso nos d\u00e1 uma importante regra de depura\u00e7\u00e3o:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Se uma op\u00e7\u00e3o de pagamento desaparecer de um carrinho de compras, n\u00e3o presuma imediatamente que a API de pagamento est\u00e1 com problemas. Primeiro, verifique o valor do carrinho, a moeda, os limites m\u00ednimo e m\u00e1ximo e os valores que atendem aos crit\u00e9rios de elegibilidade do m\u00e9todo de pagamento.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Isso se torna ainda mais importante quando descontos, custos de envio, impostos, vouchers ou c\u00e1lculos personalizados de finaliza\u00e7\u00e3o de compra est\u00e3o envolvidos.<\/span><\/p>\n<h2><strong>5.0 Por que os m\u00e9todos de pagamento funcionam no Checkout padr\u00e3o, mas falham no SuperCheckout<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Uma forma \u00fatil de investigar esses problemas \u00e9 comparar os dois ambientes de checkout.<\/span><\/p>\n<h3><strong>5.1 Finaliza\u00e7\u00e3o de compra padr\u00e3o do PrestaShop<\/strong><\/h3>\n<pre><b>Carrinho<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Localizador de op\u00e7\u00f5es de pagamento<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Ganchos de op\u00e7\u00f5es de pagamento<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>M\u00f3dulos de pagamento<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Op\u00e7\u00f5es de pagamento<\/b><\/pre>\n<h3><strong>5.2 Verifica\u00e7\u00e3o OPC<\/strong><\/h3>\n<pre><b>Carrinho<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>SuperCheckout<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>M\u00e9todos de pagamento<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>M\u00f3dulos de pagamento<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Processamento OPC adicional<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Interface de pagamento renderizada<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">O segundo fluxo possui partes m\u00f3veis adicionais.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Portanto, ao depurar um problema de pagamento, n\u00e3o verificamos apenas: &#8220;O m\u00f3dulo de pagamento est\u00e1 funcionando?&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">N\u00f3s verificamos: <\/span><span style=\"font-weight: 400;\">&#8220;O m\u00f3dulo de pagamento funciona quando sua sa\u00edda \u00e9 consumida e renderizada por esta implementa\u00e7\u00e3o espec\u00edfica de finaliza\u00e7\u00e3o de compra?&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Essa distin\u00e7\u00e3o economizou uma quantidade consider\u00e1vel de tempo de depura\u00e7\u00e3o.<\/span><\/p>\n<h2><strong>6.0 A op\u00e7\u00e3o de pagamento \u00e9 apenas uma parte da integra\u00e7\u00e3o.<\/strong><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">A partir da vers\u00e3o 1.7 do PrestaShop, os m\u00f3dulos de pagamento geralmente utilizam a abordagem mais antiga de gancho de pagamento para gerar o HTML de pagamento.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Uma op\u00e7\u00e3o de pagamento pode conter informa\u00e7\u00f5es como:<\/span><\/p>\n<pre><b>$paymentOption<\/b>\r\n<b>-&gt;setCallToActionText(...)<\/b>\r\n<b>-&gt;setAction(...)<\/b>\r\n<b>-&gt;setInputs(...)<\/b>\r\n<b>-&gt;setAdditionalInformation(...)<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">objetos em vez de diretamente<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Diferentes gateways exigem diferentes combina\u00e7\u00f5es.<\/span><\/p>\n<h3><strong>6.1 Gateway baseado em redirecionamento<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">O cliente clica no m\u00e9todo de pagamento e \u00e9 redirecionado para o gateway.<\/span><\/p>\n<pre><b>Finalizar Compra<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Op\u00e7\u00e3o de pagamento<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Controlador de m\u00f3dulo<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Gateway<\/b><\/pre>\n<h3><strong>6.2 Formul\u00e1rio de pagamento incorporado<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Os campos de pagamento s\u00e3o exibidos diretamente na p\u00e1gina de finaliza\u00e7\u00e3o da compra.<\/span><\/p>\n<pre><b>Finalizar Compra<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Op\u00e7\u00e3o de pagamento<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Formul\u00e1rio de cart\u00e3o\/pagamento<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>API de Gateway<\/b><\/pre>\n<h3><strong>6.3 Pagamento baseado em iframe<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">A interface do gateway est\u00e1 integrada ao processo de finaliza\u00e7\u00e3o da compra.<\/span><\/p>\n<pre><b>Finalizar Compra<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Op\u00e7\u00e3o de pagamento<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Iframe<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Gateway<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">As duas \u00faltimas abordagens exigem aten\u00e7\u00e3o adicional, pois JavaScript, manipula\u00e7\u00e3o do DOM, carregamento de iframe e atualiza\u00e7\u00f5es do OPC podem afetar a interface de pagamento.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<h2><strong>7.0 JavaScript torna-se crucial com OPC<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Essa \u00e9 uma \u00e1rea que os guias gen\u00e9ricos de integra\u00e7\u00e3o de pagamentos costumam ignorar.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Um OPC pode atualizar dinamicamente partes do processo de finaliza\u00e7\u00e3o da compra quando o cliente faz altera\u00e7\u00f5es:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">endere\u00e7o de entrega<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">pa\u00eds<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">portador<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">m\u00e9todo de pagamento<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Informa\u00e7\u00f5es de pagamento<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">m\u00e9todo de envio<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Quando isso acontecer, o HTML relacionado ao pagamento poder\u00e1 ser substitu\u00eddo.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Um evento JavaScript que funcionou durante o carregamento inicial da p\u00e1gina pode, portanto, parar de funcionar ap\u00f3s uma atualiza\u00e7\u00e3o AJAX.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Por exemplo:<\/span><\/p>\n<pre><b>Carregamento inicial do checkout<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>JS de pagamento inicializado<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>O cliente altera as informa\u00e7\u00f5es de pagamento\/envio.<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>OPC atualiza se\u00e7\u00e3o de pagamentos<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>DOM original substitu\u00eddo<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>O JS de pagamento n\u00e3o est\u00e1 mais anexado.<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">Isso pode produzir sintomas confusos.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">O m\u00e9todo de pagamento pode aparecer inicialmente, mas clicar nele n\u00e3o faz nada. Um iframe pode desaparecer.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Uma lista de bancos pode parar de crescer.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Uma op\u00e7\u00e3o de pagamento pode aparecer e desaparecer ap\u00f3s a altera\u00e7\u00e3o de outro campo no processo de finaliza\u00e7\u00e3o da compra.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Portanto, o trabalho de compatibilidade muitas vezes exige altera\u00e7\u00f5es n\u00e3o apenas no PHP, mas tamb\u00e9m no JavaScript do m\u00f3dulo de pagamento.<\/span><\/p>\n<h2><strong>8.0 Um exemplo real: SimplyLease + SuperCheckout<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Outro exemplo envolveu a integra\u00e7\u00e3o do SimplyLease com o SuperCheckout. O problema n\u00e3o se limitava \u00e0 API do gateway.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Algumas informa\u00e7\u00f5es e elementos da calculadora do SimplyLease faziam parte da apresenta\u00e7\u00e3o de finaliza\u00e7\u00e3o da compra\/pagamento e precisavam funcionar corretamente dentro do fluxo do SuperCheckout.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">As altera\u00e7\u00f5es de compatibilidade envolveram tanto os modelos de m\u00f3dulo quanto a integra\u00e7\u00e3o do JavaScript no SuperCheckout. Os arquivos envolvidos inclu\u00edram:<\/span><\/p>\n<pre><b>modules\/simplylease\/views\/templates\/hook\/payment_info.tpl modules\/simplylease\/views\/templates\/hook\/product_calculator.tpl<\/b>\r\n\r\n<b>modules\/supercheckout\/controllers\/front\/SupercheckoutCore.php modules\/supercheckout\/views\/js\/front\/supercheckout.js\r\n<\/b><b>modules\/supercheckout\/views\/js\/front\/simplylease_supercheckout.js<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">Este \u00e9 um bom exemplo de por que a compatibilidade de pagamentos \u00e0s vezes exige altera\u00e7\u00f5es fora do pr\u00f3prio m\u00f3dulo do gateway de pagamento.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">O provedor de pagamento pode expor os dados corretos, mas o processo de finaliza\u00e7\u00e3o da compra ainda precisa:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Renderize.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Preserve-o durante as atualiza\u00e7\u00f5es do checkout.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Inicialize o JavaScript necess\u00e1rio.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Mantenha as informa\u00e7\u00f5es de pagamento sincronizadas com o carrinho atual.<\/span><\/li>\n<\/ol>\n<h2><strong>9.0 Outro problema comum: M\u00e9todo de pagamento n\u00e3o aparece<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Tamb\u00e9m encontramos casos em que um m\u00e9todo de pagamento como o Comfino n\u00e3o aparecia no SuperCheckout, mesmo que o pr\u00f3prio m\u00f3dulo de pagamento estivesse instalado e configurado.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Esse tipo de problema deve ser investigado sistematicamente.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Verifica:<\/span><\/p>\n<h3><strong>9.1 O m\u00f3dulo est\u00e1 ativo?<\/strong><\/h3>\n<pre><b>$this-&gt;ativo<\/b><\/pre>\n<h3><strong>9.2 A moeda \u00e9 suportada?<\/strong><\/h3>\n<pre><b>$this-&gt;checkCurrency($params['cart'])<\/b><\/pre>\n<h3><strong>9.3 O pa\u00eds recebe apoio?<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Algumas plataformas de pagamento restringem os m\u00e9todos de pagamento com base no pa\u00eds do cliente.<\/span><\/p>\n<h3><strong>9.4 O total do carrinho est\u00e1 dentro dos limites do gateway de pagamento?<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Os valores m\u00ednimo e m\u00e1ximo de transa\u00e7\u00e3o podem impedir que um m\u00e9todo seja exibido.<\/span><\/p>\n<h3><strong>9.5 A operadora \u00e9 compat\u00edvel?<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Alguns m\u00f3dulos de pagamento restringem os m\u00e9todos de pagamento por operadora.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<h3><strong>9.6 O m\u00e9todo \u00e9 a filtragem OPC?<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">O m\u00f3dulo de pagamento pode retornar m\u00e9todos v\u00e1lidos que s\u00e3o coletados, filtrados ou renderizados.<\/span><span style=\"font-weight: 400;\"> Mas o OPC ainda pode modificar a forma de pagamento.<\/span><\/p>\n<h3><strong>9.7 O JavaScript est\u00e1 ocultando ou substituindo o elemento?<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Tecnicamente, um m\u00e9todo de pagamento pode ser retornado pelo PHP, mas ainda assim n\u00e3o estar vis\u00edvel na p\u00e1gina final de finaliza\u00e7\u00e3o da compra.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00c9 por isso que as ferramentas de desenvolvedor do navegador s\u00e3o t\u00e3o importantes quanto os logs do PHP ao depurar integra\u00e7\u00f5es de pagamento.<\/span><\/p>\n<h2><strong>10.0 Ganchos aos quais realmente precisamos prestar aten\u00e7\u00e3o<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Uma integra\u00e7\u00e3o de pagamento personalizada n\u00e3o deve ser tratada como uma implementa\u00e7\u00e3o de gancho \u00fanico.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Os mecanismos exatos dependem da arquitetura do gateway e do processo de finaliza\u00e7\u00e3o da compra, mas alguns s\u00e3o especialmente importantes.<\/span><\/p>\n<h3>10.1 Op\u00e7\u00f5es de pagamento<\/h3>\n<p><span style=\"font-weight: 400;\">Este \u00e9 o principal meio de expor o m\u00e9todo de pagamento ao processo de finaliza\u00e7\u00e3o da compra.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00c9 respons\u00e1vel pela devolu\u00e7\u00e3o.<\/span> Op\u00e7\u00f5es de pagamento <span style=\"font-weight: 400;\">objetos.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">As verifica\u00e7\u00f5es t\u00edpicas incluem:<\/span><\/p>\n<pre><b>se (!$this-&gt;ativo) { retornar [];<\/b>\r\n<b>}<\/b>\r\n<b>if (!$this-&gt;checkCurrency($params['cart'])) { return [];<\/b>\r\n<b>}<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">Restri\u00e7\u00f5es adicionais espec\u00edficas do gateway podem ent\u00e3o ser aplicadas.<\/span><\/p>\n<h3>10.2 Devolu\u00e7\u00f5es de pagamento<\/h3>\n<p><span style=\"font-weight: 400;\">Esta op\u00e7\u00e3o \u00e9 utilizada ap\u00f3s o cliente concluir ou retornar do fluxo de pagamento. Ela pode exibir:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">refer\u00eancia do pedido<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">status do pagamento<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">instru\u00e7\u00f5es de pagamento adicionais<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">informa\u00e7\u00f5es espec\u00edficas do gateway<\/span><\/li>\n<\/ul>\n<h3>10.3 op\u00e7\u00f5esDePagamentoPresente<\/h3>\n<p><span style=\"font-weight: 400;\">Essa funcionalidade torna-se particularmente interessante quando v\u00e1rios m\u00f3dulos de pagamento e um OPC est\u00e3o envolvidos.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Ele opera com base nas op\u00e7\u00f5es de pagamento reunidas e pode ser \u00fatil quando o sistema de finaliza\u00e7\u00e3o de compra precisa inspecionar ou modificar todo o conjunto de op\u00e7\u00f5es de pagamento.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Isso \u00e9 diferente de implementar as op\u00e7\u00f5es de pagamento de um \u00fanico gateway.<\/span> <span style=\"font-weight: 400;\">gancho.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A distin\u00e7\u00e3o \u00e9 importante:<\/span><\/p>\n<pre><b>Op\u00e7\u00f5es de pagamento<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Cada m\u00f3dulo de pagamento contribui com sua op\u00e7\u00e3o.<\/b>\r\n<b>op\u00e7\u00f5esDePagamentoPresentes<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>As op\u00e7\u00f5es de pagamento reunidas podem ser processadas.<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">Ao depurar a compatibilidade com OPC, entender onde as op\u00e7\u00f5es de pagamento s\u00e3o coletadas e onde s\u00e3o apresentadas pode fazer toda a diferen\u00e7a entre encontrar o problema rapidamente e passar horas analisando o m\u00f3dulo do gateway.<\/span><\/p>\n<h2><strong>11.0 Cria\u00e7\u00e3o de Pedidos: Nunca Confie no Navegador<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Assim que o pagamento \u00e9 recebido pelo gateway, a pr\u00f3xima etapa crucial \u00e9 a cria\u00e7\u00e3o do pedido. O m\u00e9todo mais importante do PrestaShop nesse processo \u00e9:<\/span><\/p>\n<pre>validarPedido()<\/pre>\n<p><span style=\"font-weight: 400;\">Um exemplo simplificado \u00e9:<\/span><\/p>\n<pre><b>$this-&gt;module-&gt;validateOrder(<\/b>\r\n<b>$cart-&gt;id, Configuration::get('PS_OS_PAYMENT'),<\/b>\r\n<b>$valorPago,<\/b>\r\n<b>$paymentMethod,<\/b>\r\n<b>$mensagem, [],<\/b>\r\n<b>nulo, falso,<\/b>\r\n<b>$customer-&gt;secure_key<\/b>\r\n<b>);<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">Existem tr\u00eas valores que merecem aten\u00e7\u00e3o especial:<\/span><\/p>\n<h3><strong>11.1 ID do Carrinho<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">O carrinho deve pertencer ao cliente\/sess\u00e3o esperado e deve ser v\u00e1lido.<\/span><\/p>\n<h3><strong>11.2 Valor do pagamento<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">N\u00e3o utilize indiscriminadamente:<\/span><\/p>\n<pre><b>$cart-&gt;getOrderTotal()<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">como comprovante de que o gateway recebeu esse valor.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">O valor deve ser validado em rela\u00e7\u00e3o \u00e0 resposta do gateway.<\/span><\/p>\n<h3><strong>11.3 Chave segura<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">O cliente <\/span><span style=\"font-weight: 400;\">Deve estar corretamente associado ao fluxo do carrinho\/pedido.<\/span><\/p>\n<h2><strong>12.0 Os webhooks devem ser idempotentes.<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Um gateway de pagamento pode enviar o mesmo webhook mais de uma vez. Por exemplo:<\/span><\/p>\n<pre><b>Gateway<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>webhook<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Seu servidor<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Resposta 200<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">Caso a resposta seja perdida:<\/span><\/p>\n<pre><b>Gateway<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>webhook<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Seu servidor<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Resposta perdida<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Tentativas de reentrada do gateway<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">Se a integra\u00e7\u00e3o criar um pedido sempre que receber um webhook, pedidos duplicados se tornam poss\u00edveis. Portanto, o callback deve verificar se o carrinho j\u00e1 possui um pedido antes de criar outro. Conceitualmente:<\/span><\/p>\n<pre><b>se ($carrinho-&gt;PedidoExiste()) {<\/b>\r\n<b>\/\/ J\u00e1 processado<\/b>\r\n<b>\/\/ Retorna resposta bem-sucedida<\/b>\r\n<b>}<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">O manipulador de webhook deve ser projetado para processar notifica\u00e7\u00f5es repetidas com seguran\u00e7a.<\/span><\/p>\n<h2><strong>13.0 Pagamento S\u00edncrono vs. Ass\u00edncrono<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Nem todos os gateways de pagamento confirmam o pagamento imediatamente.<\/span><\/p>\n<h3><strong>13.1 S\u00edncrono<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">O gateway confirma a transa\u00e7\u00e3o imediatamente.<\/span><\/p>\n<pre><b>O cliente<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Gateway<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Pagamento aprovado<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>validarPedido()<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>PS_OS_PAGAMENTO<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Confirma\u00e7\u00e3o<\/b><\/pre>\n<h3><strong>13.2 Ass\u00edncrono<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">O cliente poder\u00e1 efetuar a devolu\u00e7\u00e3o antes da chegada da confirma\u00e7\u00e3o final do pagamento.<\/span><\/p>\n<pre><b>O cliente<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Gateway<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Voltar para a loja<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Pedido pendente<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>webhook<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Verificar pagamento<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Alterar estado do pedido<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Pagamento aceito<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">Para gateways ass\u00edncronos, usar um estado de pedido pendente dedicado costuma ser mais seguro do que marcar o pedido como pago imediatamente.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Assim que o webhook confirmar o pagamento:<\/span><\/p>\n<pre><b>$history = novo OrderHistory();<\/b>\r\n<b>$history-&gt;id_order = (int) $order-&gt;id;<\/b>\r\n<b>$history-&gt;changeIdOrderState( Configuration::get('PS_OS_PAYMENT'),<\/b>\r\n<b>$order<\/b>\r\n<b>);<\/b>\r\n<b>$history-&gt;addWithemail(true);<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">Isso garante que a transi\u00e7\u00e3o do estado do pedido passe pelo mecanismo de hist\u00f3rico de pedidos do PrestaShop, em vez de simplesmente alterar o valor no banco de dados.<\/span><\/p>\n<h2><strong>14.0 Uma das t\u00e9cnicas de depura\u00e7\u00e3o mais \u00fateis: comparar os fluxos de finaliza\u00e7\u00e3o da compra<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Quando um m\u00e9todo de pagamento funciona no checkout padr\u00e3o, mas n\u00e3o no OPC, recomendamos comparar todo o fluxo.<\/span><\/p>\n<h3><strong>Passo 1: Verificar PHP<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">\u00c9 hookPaymentOptions() <\/span><span style=\"font-weight: 400;\">executado?<\/span><\/p>\n<h3><strong>Etapa 2: Inspecione as op\u00e7\u00f5es retornadas<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">O m\u00f3dulo de pagamento realmente retorna um<\/span> op\u00e7\u00e3o de pagamento<span style=\"font-weight: 400;\">?<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<h3><strong>Passo 3: Confira o carrinho<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Comparar:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">total<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">moeda<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">cliente<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">pa\u00eds<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">portador<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">descontos<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">impostos<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Remessa<\/span><\/li>\n<\/ul>\n<h3><strong>Passo 4: Verifique o navegador<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Olhe para:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Erros de JavaScript<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Elementos DOM ausentes<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Requisi\u00e7\u00f5es AJAX<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">solicita\u00e7\u00f5es falharam<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">erros de iframe<\/span><\/li>\n<\/ul>\n<h3><strong>Etapa 5: Verifique o OPC<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Determine se o SuperCheckout \u00e9:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">filtrando a op\u00e7\u00e3o de pagamento<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">substituindo seu HTML<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Atualizando a se\u00e7\u00e3o de pagamento<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Alterar o carrinho antes da execu\u00e7\u00e3o do m\u00f3dulo de pagamento.<\/span><\/li>\n<\/ul>\n<h3><strong>Etapa 6: Verifique o gateway<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Somente ap\u00f3s a confirma\u00e7\u00e3o do fluxo de caixa local \u00e9 que a investiga\u00e7\u00e3o deve prosseguir para:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Autentica\u00e7\u00e3o de API<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">carga \u00fatil de solicita\u00e7\u00e3o<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">assinatura<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">resposta<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">webhooks<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">registros do gateway<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Essa abordagem em camadas \u00e9 muito mais r\u00e1pida do que come\u00e7ar sempre com a API do gateway.<\/span><\/p>\n<h2><strong>15.0 Problemas comuns de integra\u00e7\u00e3o de pagamentos que observamos<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">O trabalho de compatibilidade no mundo real geralmente exp\u00f5e problemas que n\u00e3o s\u00e3o \u00f3bvios na documenta\u00e7\u00e3o do gateway.<\/span><\/p>\n<h3><strong>15.1 A op\u00e7\u00e3o de pagamento desapareceu.<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Causas poss\u00edveis:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">moeda n\u00e3o suportada<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">restri\u00e7\u00e3o do pa\u00eds<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Valor do carrinho acima dos limites do gateway<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">restri\u00e7\u00e3o da operadora<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Filtragem OPC<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Configura\u00e7\u00e3o do m\u00f3dulo de pagamento<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">JavaScript ocultando o m\u00e9todo<\/span><\/li>\n<\/ul>\n<h3><strong>15.2 BLIK ou outra op\u00e7\u00e3o de pagamento aparece e desaparece<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Causas poss\u00edveis:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Confira a atualiza\u00e7\u00e3o AJAX<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">nova renderiza\u00e7\u00e3o da op\u00e7\u00e3o de pagamento<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Inicializa\u00e7\u00e3o do JavaScript<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Total do carrinho em altera\u00e7\u00e3o<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">A elegibilidade do gateway est\u00e1 sendo recalculada.<\/span><\/li>\n<\/ul>\n<h3><strong>15.3 A lista de bancos n\u00e3o se expande<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Investigar frequentemente:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Erros de JavaScript<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">elementos DOM substitu\u00eddos dinamicamente<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">manipuladores de eventos anexados antes da atualiza\u00e7\u00e3o do OPC<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Inicializa\u00e7\u00e3o JavaScript do provedor de pagamento<\/span><\/li>\n<\/ul>\n<h3><strong>15.4 O iframe desaparece<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Investigar:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">atualizar finaliza\u00e7\u00e3o da compra<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Inicializa\u00e7\u00e3o de iframe<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Substitui\u00e7\u00e3o do DOM<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Execu\u00e7\u00e3o de JavaScript ap\u00f3s atualiza\u00e7\u00f5es AJAX<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/li>\n<\/ul>\n<h3><strong>15.5 O pagamento foi efetuado com sucesso, mas o pedido permanece pendente.<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Verifica:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">URL do webhook<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">entrega de webhook<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">verifica\u00e7\u00e3o de assinatura<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">consulta de carrinho\/pedido<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">transi\u00e7\u00e3o de estado de ordem<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">autentica\u00e7\u00e3o de retorno de chamada<\/span><\/li>\n<\/ul>\n<h3><strong>15.6 O m\u00e9todo de pagamento funciona no checkout padr\u00e3o, mas n\u00e3o no OPC.<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Isso indica fortemente que o problema pode estar na intera\u00e7\u00e3o entre o m\u00f3dulo de pagamento e o OPC, e n\u00e3o na pr\u00f3pria API do gateway.<\/span><\/p>\n<h2><strong>16.0 Requisitos de seguran\u00e7a para um m\u00f3dulo de pagamento<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Os m\u00f3dulos de pagamento lidam com opera\u00e7\u00f5es sens\u00edveis, portanto a seguran\u00e7a n\u00e3o pode ser tratada como uma melhoria opcional. No m\u00ednimo:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Validar assinaturas de retorno de chamada.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Valide a rela\u00e7\u00e3o entre o carrinho e o cliente.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Usar HTTPS.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Validar certificados TLS.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Nunca confie apenas no status de pagamento fornecido pelo navegador.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Nunca armazene informa\u00e7\u00f5es brutas de cart\u00f5es de cr\u00e9dito, a menos que a arquitetura e os requisitos de conformidade o permitam explicitamente.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">N\u00e3o registre informa\u00e7\u00f5es de pagamento confidenciais.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">\n<pre><span style=\"font-weight: 400;\">Evite serializar() e desserializar() <\/span>\/ para dados externos n\u00e3o confi\u00e1veis.<\/pre>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Validar e converter os valores recebidos.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Proteja endpoints AJAX e de retorno de chamada personalizados.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Utilize tokens seguros quando apropriado.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Tornar o processamento de webhooks idempotente.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Uma p\u00e1gina de confirma\u00e7\u00e3o de pagamento n\u00e3o constitui comprovante de pagamento.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A resposta verificada do servidor do gateway \u00e9 o que deve determinar se o pedido \u00e9 considerado pago.<\/span><\/p>\n<h2><strong>17.0 O que muda ao dar suporte a v\u00e1rios m\u00f3dulos de pagamento?<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Outra li\u00e7\u00e3o aprendida com o trabalho de compatibilidade com OPC \u00e9 que adicionar um segundo ou terceiro m\u00f3dulo de pagamento pode expor problemas que n\u00e3o eram vis\u00edveis quando existia apenas um m\u00e9todo de pagamento.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Por exemplo:<\/span><\/p>\n<pre><b>PayPal <\/b><b>PayU<\/b>\r\n<b>Comfino<\/b>\r\n<b>SimplyLease<\/b>\r\n<b>transfer\u00eancia banc\u00e1ria<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">Todas podem contribuir com op\u00e7\u00f5es de pagamento para o mesmo checkout. Portanto, o checkout precisa lidar com diferentes:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Estruturas HTML<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">JavaScript<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Requisitos do iframe<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">redirecionamentos<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Fluxos de API<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">regras de elegibilidade<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">valores m\u00ednimos\/m\u00e1ximos<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">retornos de chamada ass\u00edncronos<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Uma altera\u00e7\u00e3o feita em um m\u00e9todo de pagamento pode afetar acidentalmente outro. \u00c9 por isso que as corre\u00e7\u00f5es de compatibilidade de pagamento devem ter um escopo bem definido.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Por exemplo, em vez de alterar toda a l\u00f3gica de processamento de op\u00e7\u00f5es de pagamento globalmente, identifique o m\u00e9todo de pagamento espec\u00edfico e aplique o tratamento de compatibilidade apenas onde for necess\u00e1rio.<\/span><\/p>\n<h2><strong>18.0 Os testes devem incluir cen\u00e1rios reais de carrinho de compras.<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Testar um gateway de pagamento com um produto simples de \u20ac10 n\u00e3o \u00e9 suficiente. Uma matriz de testes adequada deve incluir:<\/span><\/p>\n<table class=\"table table-hover\">\n<tbody>\n<tr>\n<td><strong>Cen\u00e1rio<\/strong><\/td>\n<td><strong>O que verificar<\/strong><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">\u00danico produto<\/span><\/td>\n<td><span style=\"font-weight: 400;\">A op\u00e7\u00e3o de pagamento aparece.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">V\u00e1rios produtos<\/span><\/td>\n<td><span style=\"font-weight: 400;\">A quantia correta chega ao port\u00e3o<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Desconto<\/span><\/td>\n<td><span style=\"font-weight: 400;\">O valor final a pagar est\u00e1 correto.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Taxa de envio<\/span><\/td>\n<td><span style=\"font-weight: 400;\">O gateway recebe o total correto.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Tribut\u00e1rio<\/span><\/td>\n<td><span style=\"font-weight: 400;\">O valor do gateway corresponde ao pedido.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Valor m\u00ednimo do gateway<\/span><\/td>\n<td><span style=\"font-weight: 400;\">O m\u00e9todo aparece\/desaparece corretamente<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Valor m\u00e1ximo do gateway<\/span><\/td>\n<td><span style=\"font-weight: 400;\">O m\u00e9todo aparece\/desaparece corretamente<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Moeda n\u00e3o suportada<\/span><\/td>\n<td><span style=\"font-weight: 400;\">O m\u00e9todo est\u00e1 oculto<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Pa\u00eds n\u00e3o suportado<\/span><\/td>\n<td><span style=\"font-weight: 400;\">O m\u00e9todo est\u00e1 oculto<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Checkout padr\u00e3o<\/span><\/td>\n<td><span style=\"font-weight: 400;\">O pagamento funciona<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">OPC<\/span><\/td>\n<td><span style=\"font-weight: 400;\">O pagamento funciona<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Caixa para celular<\/span><\/td>\n<td><span style=\"font-weight: 400;\">A interface do usu\u00e1rio funciona<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Falha no pagamento<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Estado correto do pedido\/pagamento<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Pagamento bem sucedido<\/span><\/td>\n<td><span style=\"font-weight: 400;\">O pedido foi criado corretamente.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Tentativa de refazer o webhook<\/span><\/td>\n<td><span style=\"font-weight: 400;\">N\u00e3o \u00e9 permitido fazer pedidos duplicados.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Abandono do cliente<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Nenhum pedido pago incorretamente<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Tempo limite do gateway<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Corre\u00e7\u00e3o do tratamento de erros\/pend\u00eancias<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400;\">Para integra\u00e7\u00f5es OPC, teste tamb\u00e9m as atualiza\u00e7\u00f5es do checkout. Altere o:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">endere\u00e7o<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">portador<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">pa\u00eds<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">m\u00e9todo de pagamento<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">quantidade<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">desconto<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">e verifique se as op\u00e7\u00f5es de pagamento permanecem corretas ap\u00f3s cada atualiza\u00e7\u00e3o.<\/span><\/p>\n<h2><strong>19.0 Uma abordagem pr\u00e1tica de desenvolvimento<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Com base nos problemas que geralmente surgem em integra\u00e7\u00f5es reais, uma ordem de desenvolvimento mais segura \u00e9:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<h3><strong>19.1 Fa\u00e7a o gateway funcionar com o checkout padr\u00e3o do PrestaShop<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Primeiro, estabele\u00e7a que:<\/span><\/p>\n<pre><b>Op\u00e7\u00e3o de pagamento<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Solicita\u00e7\u00e3o de gateway<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Resposta do gateway<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>validarPedido()<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Confirma\u00e7\u00e3o<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">funciona corretamente.<\/span><\/p>\n<h3><strong>19.2 Adicionar processamento de callback\/webhook<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">N\u00e3o deixe a confirma\u00e7\u00e3o ass\u00edncrona para o final.<\/span><\/p>\n<h3><strong>19.3 Adicionar tratamento adequado do estado do pedido<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Teste:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">sucesso<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">falha<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">pendente<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">tempo limite<\/span><\/li>\n<\/ul>\n<h3><strong>19.4 Teste com cartuchos realistas<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Utilize descontos, frete, impostos, diferentes moedas e totais variados.<\/span><\/p>\n<h3><strong>19.5 Integrar com OPC<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Somente ap\u00f3s o fluxo b\u00e1sico do gateway estar est\u00e1vel voc\u00ea deve investigar a compatibilidade com o SuperCheckout.<\/span><\/p>\n<h3><strong>19.6 Teste JavaScript e atualiza\u00e7\u00f5es din\u00e2micas<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Isso \u00e9 particularmente importante para formul\u00e1rios de pagamento incorporados, iframes, interfaces BLIK\/sele\u00e7\u00e3o de banco e outros componentes de pagamento interativos.<\/span><\/p>\n<h3><strong>19.7 Teste todos os m\u00e9todos de pagamento em conjunto<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Um sistema de finaliza\u00e7\u00e3o de compra que suporta cinco m\u00e9todos de pagamento precisa ser testado como um sistema, e n\u00e3o como cinco m\u00f3dulos isolados.<\/span><\/p>\n<h2><strong>20.0 Devo criar um gateway personalizado ou usar um m\u00f3dulo existente?<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Nem todos os gateways justificam uma integra\u00e7\u00e3o personalizada. Um m\u00f3dulo personalizado faz sentido quando:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">A porta de entrada \u00e9 regional ou de nicho.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">N\u00e3o existe nenhum m\u00f3dulo PrestaShop com suporte.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">O gateway requer l\u00f3gica de neg\u00f3cios personalizada.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Voc\u00ea precisa de um fluxo de trabalho espec\u00edfico para assinaturas ou pagamentos.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Voc\u00ea precisa de funcionalidades que os m\u00f3dulos existentes n\u00e3o conseguem fornecer.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Mas construir uma integra\u00e7\u00e3o de pagamento tamb\u00e9m significa aceitar a responsabilidade pela manuten\u00e7\u00e3o. O PrestaShop muda.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Altera\u00e7\u00f5es no PHP. Altera\u00e7\u00f5es nas APIs do Gateway.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Os requisitos de seguran\u00e7a mudam. Os m\u00f3dulos de finaliza\u00e7\u00e3o da compra mudam.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">E eventualmente o provedor de pagamentos altera algo que quebra uma integra\u00e7\u00e3o que, de outra forma, seria est\u00e1vel.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Para gateways de pagamento convencionais, um m\u00f3dulo estabelecido e com manuten\u00e7\u00e3o regular pode, portanto, ser significativamente mais barato do que manter um c\u00f3digo de pagamento personalizado por v\u00e1rios anos.<\/span><\/p>\n<h2><strong>21.0 A Li\u00e7\u00e3o Mais Importante da Integra\u00e7\u00e3o de Pagamentos do PrestaShop<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">A maior li\u00e7\u00e3o ao trabalhar com gateways de pagamento \u00e9 que a API geralmente n\u00e3o \u00e9 a parte mais dif\u00edcil. Envio:<\/span><\/p>\n<pre><b>Solicita\u00e7\u00e3o de API <\/b><span style=\"font-weight: 400;\">\u2192 <\/span><b>Resposta da API<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">Geralmente \u00e9 simples.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A parte dif\u00edcil \u00e9 tudo o que a rodeia:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">\u250c\u2500\u2500 <\/span><b>Regras monet\u00e1rias<\/b>\r\n<span style=\"font-weight: 400;\">\u2500\u2500\u2500 <\/span><b>Regras do pa\u00eds<\/b>\r\n<span style=\"font-weight: 400;\">\u2500\u2500\u2500 <\/span><b>Valor do carrinho<\/b>\r\n<span style=\"font-weight: 400;\">\u2500\u2500\u2500 <\/span><b>Restri\u00e7\u00f5es da operadora<\/b>\r\n<span style=\"font-weight: 400;\">\u2500\u2500\u2500 <\/span><b>OPC<\/b>\r\n<span style=\"font-weight: 400;\">\u2500\u2500\u2500 <\/span><b>JavaScript<\/b>\r\n<span style=\"font-weight: 400;\">\u2500\u2500\u2500 <\/span><b>Iframes<\/b>\r\n<span style=\"font-weight: 400;\">\u2500\u2500\u2500 <\/span><b>Atualiza\u00e7\u00f5es AJAX<\/b>\r\n<span style=\"font-weight: 400;\">\u2500\u2500\u2500 <\/span><b>Webhooks<\/b>\r\n<span style=\"font-weight: 400;\">\u2500\u2500\u2500 <\/span><b>A ordem afirma<\/b>\r\n<span style=\"font-weight: 400;\">\u2500\u2500\u2500 <\/span><b>notifica\u00e7\u00f5es duplicadas<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>O cliente <\/b><span style=\"font-weight: 400;\">\u2192 <\/span><b>Finalizar Compra <\/b><span style=\"font-weight: 400;\">\u2192 <\/span><b>M\u00f3dulo de Pagamento <\/b><span style=\"font-weight: 400;\">\u2192 <\/span><b>Gateway<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>Cria\u00e7\u00e3o de pedido<\/b>\r\n<span style=\"font-weight: 400;\">\u2193<\/span>\r\n<b>A confirma\u00e7\u00e3o da ordem<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">A integra\u00e7\u00e3o de pagamentos s\u00f3 \u00e9 bem-sucedida quando toda a cadeia se comporta de forma consistente.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00c9 por isso tamb\u00e9m que um problema como &#8220;BLIK ausente&#8221; ou &#8220;a lista de bancos n\u00e3o abre&#8221; n\u00e3o deve ser tratado imediatamente como um problema da API do gateway.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A causa real pode ser o c\u00e1lculo do total do carrinho, a verifica\u00e7\u00e3o de elegibilidade do m\u00e9todo de pagamento, a renderiza\u00e7\u00e3o OPC, a inicializa\u00e7\u00e3o do JavaScript ou uma atualiza\u00e7\u00e3o AJAX que substitui a interface de pagamento.<\/span><\/p>\n<h2><strong>22.0 Lista de verifica\u00e7\u00e3o final para um gateway de pagamento personalizado do PrestaShop<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Antes de considerar a integra\u00e7\u00e3o conclu\u00edda, verifique:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">O m\u00f3dulo de pagamento \u00e9 ampliado.<\/span> <strong>M\u00f3dulo de Pagamento<\/strong>.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><b>Op\u00e7\u00f5es de pagamento <\/b><span style=\"font-weight: 400;\">est\u00e1 implementado corretamente.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><b>retorno do pagamento <\/b><span style=\"font-weight: 400;\">\u00c9 implementado onde necess\u00e1rio.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Op\u00e7\u00f5es de pagamento utilizadas<\/span> Op\u00e7\u00f5es de pagamento.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">As restri\u00e7\u00f5es cambiais foram verificadas.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">As restri\u00e7\u00f5es de pa\u00eds e de companhia a\u00e9rea s\u00e3o verificadas quando aplic\u00e1veis.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Os totais do carrinho foram validados.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">As respostas do gateway s\u00e3o verificadas.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">As assinaturas de retorno de chamada s\u00e3o validadas.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\"><strong>ValidarPedido()<\/strong> A chamada \u00e9 feita somente ap\u00f3s a verifica\u00e7\u00e3o bem-sucedida do pagamento.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">O valor utilizado no pedido \u00e9 validado em rela\u00e7\u00e3o \u00e0 resposta do gateway.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Os webhooks s\u00e3o idempotentes.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Notifica\u00e7\u00f5es duplicadas n\u00e3o criam pedidos duplicados.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Os estados de ordem corretos s\u00e3o utilizados.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Pagamentos falhados e pagamentos pendentes s\u00e3o tratados separadamente.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Dados de pagamento sens\u00edveis nunca s\u00e3o registrados ou armazenados desnecessariamente.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">O HTTPS \u00e9 obrigat\u00f3rio.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">O checkout padr\u00e3o do PrestaShop foi testado.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">O OPC foi testado separadamente.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">O JavaScript foi testado ap\u00f3s atualiza\u00e7\u00f5es da p\u00e1gina de finaliza\u00e7\u00e3o de compra via AJAX.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Os iframes e os elementos de pagamento interativos foram testados.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">V\u00e1rios m\u00f3dulos de pagamento foram testados em conjunto.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Carrinhos de compras realistas com descontos e frete foram testados.<\/span><\/li>\n<\/ul>\n<h2><strong>Conclus\u00e3o<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Um gateway de pagamento personalizado no PrestaShop \u00e9 mais do que uma simples integra\u00e7\u00e3o de API.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A API \u00e9 apenas uma parte da implementa\u00e7\u00e3o. O verdadeiro desafio de engenharia come\u00e7a quando o m\u00f3dulo de pagamento precisa coexistir com o checkout do PrestaShop, um OPC como o SuperCheckout, outros m\u00f3dulos de pagamento, JavaScript din\u00e2mico, rec\u00e1lculos de carrinho e callbacks ass\u00edncronos do gateway.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Nossa experi\u00eancia com problemas de compatibilidade de pagamentos refor\u00e7ou uma abordagem importante: sempre isolar onde ocorre a falha antes de alterar o c\u00f3digo.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Se o m\u00e9todo de pagamento n\u00e3o for retornado pelo PHP, investigue o m\u00f3dulo de pagamento e suas regras de elegibilidade. Se o PHP o retornar, mas o cliente n\u00e3o o visualizar, investigue o OPC e a renderiza\u00e7\u00e3o do frontend. Se a interface do usu\u00e1rio aparecer, mas n\u00e3o responder, investigue o JavaScript e as atualiza\u00e7\u00f5es AJAX. Se o pagamento for bem-sucedido, mas o pedido permanecer pendente, investigue o retorno de chamada e o fluxo de estado do pedido.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Essa abordagem \u00e9 muito mais confi\u00e1vel do que presumir que todo problema de pagamento seja um problema de API.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Para desenvolvedores que trabalham em integra\u00e7\u00f5es de pagamento para PrestaShop, o objetivo n\u00e3o deve ser simplesmente fazer com que um gateway aceite uma transa\u00e7\u00e3o. O objetivo \u00e9 tornar todo o ciclo de vida do pagamento confi\u00e1vel \u2014 desde a primeira renderiza\u00e7\u00e3o da p\u00e1gina de finaliza\u00e7\u00e3o da compra at\u00e9 o estado final de pedido verificado \u2014 mesmo quando v\u00e1rios m\u00e9todos de pagamento e um OPC personalizado est\u00e3o envolvidos.<\/span><\/p>\n<div class=\"thecontent\">\n<div class=\"thecontent\">\n<p>Se voc\u00ea tiver d\u00favidas ou precisar de ajuda com o desempenho ou a migra\u00e7\u00e3o do seu site, nossos especialistas est\u00e3o \u00e0 disposi\u00e7\u00e3o. Entre em contato com a equipe da Knowband pelo endere\u00e7o:\u00a0<a href=\"\/pt\/cdn-cgi\/l\/email-protection#e695939696899492a68d88899184878882c885898b\" target=\"_blank\" rel=\"noopener\"><span class=\"__cf_email__\" data-cfemail=\"f3808683839c8187b3989d9c8491929d97dd909c9e\">conveyors.au@prok.com<\/span><\/a> Hoje, voc\u00ea encontra plugins de e-commerce confi\u00e1veis \u200b\u200be personalizados para atender \u00e0s suas necessidades de com\u00e9rcio eletr\u00f4nico.<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Integrar um gateway de pagamento ao PrestaShop pode parecer simples no papel. O gateway fornece documenta\u00e7\u00e3o da API, credenciais de sandbox, chaves de autentica\u00e7\u00e3o, URLs de retorno de chamada e alguns endpoints. O m\u00f3dulo PrestaShop ent\u00e3o envia a solicita\u00e7\u00e3o de pagamento, recebe a resposta, cria o pedido e redireciona o cliente para a p\u00e1gina de [&hellip;]<\/p>\n","protected":false},"author":43,"featured_media":841342,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kbui_enabled":"","footnotes":""},"categories":[53729,4,3271,218],"tags":[53407,53246,53422,53421,53248,53411,53410,53416,53427,39332,53418,53424,53403,53401,53400,53408,53426,53404,53402,53428,34596,53405,53406,53413,53409,53423,53247,53420,39318,53229,27690,42263,53419,53425,53249,53412,53417,53230,53415,53414],"class_list":["post-841324","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-comercio-eletronico-pt-br","category-ecommerce-blog","category-prestashop-pt-br","category-sin-categorizar","tag-api-de-pagamento-prestashop","tag-blik-prestashop","tag-checkout-ajax-do-prestashop","tag-checkout-em-javascript-do-prestashop","tag-comfino-prestashop","tag-compatibilidade-com-gateways-de-pagamento","tag-compatibilidade-de-pagamento-com-prestashop","tag-criao-de-pedidos-prestashop","tag-desenvolvimento-de-pagamentos-prestashop","tag-enviar-clave-de-servicio-web-de-forma-segura","tag-fluxo-de-pagamento-prestashop","tag-formulrio-de-pagamento-incorporado","tag-gateway-de-pagamento-personalizado-prestashop","tag-gateway-de-pagamento-prestashop","tag-integrao-da-api-do-prestashop","tag-integrao-de-api-de-gateway-de-pagamento","tag-integrao-de-pagamento-personalizada","tag-integrao-de-pagamento-prestashop","tag-integrao-do-gateway-de-pagamento-prestashop","tag-integrao-do-gateway-prestashop","tag-mtodos-de-pagamento-prestashop","tag-mdulo-de-pagamento-personalizado-para-prestashop","tag-mdulo-de-pagamento-prestashop","tag-opes-de-pagamento-do-prestashop","tag-pagamento-prestashop","tag-pagamento-prestashop-iframe","tag-payu-prestashop","tag-personalizao-do-checkout-do-prestashop","tag-prestashop-api-integration","tag-prestashop-opc","tag-prestashop-verificao-de-uma-pgina","tag-prestashop-verificacao-de-uma-pagina","tag-processamento-de-pagamentos-prestashop","tag-segurana-de-pagamento-prestashop","tag-simplylease-prestashop","tag-soluo-de-problemas-de-pagamento-no-prestashop","tag-status-do-pedido-prestashop","tag-supercheckout-prestashop","tag-webhooks-de-gateway-de-pagamento","tag-webhooks-do-prestashop"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Integra\u00e7\u00e3o de Gateway de Pagamento no PrestaShop: Guia de API e OPC<\/title>\n<meta name=\"description\" content=\"Aprenda a integrar um gateway de pagamento personalizado ao PrestaShop, lidar com APIs, webhooks e estados de pedido, al\u00e9m de solucionar problemas de compatibilidade com o OPC.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.knowband.com\/blog\/pt-br\/ecommerce-blog\/prestashop-payment-gateway-integration\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Integra\u00e7\u00e3o de Gateway de Pagamento no PrestaShop: Guia de API e OPC\" \/>\n<meta property=\"og:description\" content=\"Aprenda a integrar um gateway de pagamento personalizado ao PrestaShop, lidar com APIs, webhooks e estados de pedido, al\u00e9m de solucionar problemas de compatibilidade com o OPC.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.knowband.com\/blog\/pt-br\/ecommerce-blog\/prestashop-payment-gateway-integration\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowband Blog | Ecommerce Modules\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Knowband\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-09T12:21:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-09-15T06:36:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2026\/09\/Portuguese-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"760\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sophie\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@KnowbandPlugin\" \/>\n<meta name=\"twitter:site\" content=\"@KnowbandPlugin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sophie\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"18 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/pt-br\\\/ecommerce-blog\\\/prestashop-payment-gateway-integration\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/pt-br\\\/ecommerce-blog\\\/prestashop-payment-gateway-integration\\\/\"},\"author\":{\"name\":\"Sophie\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#\\\/schema\\\/person\\\/ca485d026e41cbf45ae99b67d0c9ac74\"},\"headline\":\"Integra\u00e7\u00e3o de um gateway de pagamento personalizado no PrestaShop: Requisitos t\u00e9cnicos, fluxo da API e desafios reais do OPC\",\"datePublished\":\"2026-09-09T12:21:13+00:00\",\"dateModified\":\"2026-09-15T06:36:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/pt-br\\\/ecommerce-blog\\\/prestashop-payment-gateway-integration\\\/\"},\"wordCount\":4423,\"publisher\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/pt-br\\\/ecommerce-blog\\\/prestashop-payment-gateway-integration\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/Portuguese-1.jpg\",\"keywords\":[\"API de pagamento PrestaShop\",\"BLIK PrestaShop\",\"Checkout AJAX do PrestaShop\",\"Checkout em JavaScript do PrestaShop\",\"Comfino PrestaShop\",\"compatibilidade com gateways de pagamento\",\"Compatibilidade de pagamento com PrestaShop\",\"Cria\u00e7\u00e3o de pedidos PrestaShop\",\"Desenvolvimento de pagamentos PrestaShop\",\"Enviar clave de servicio web de forma segura\",\"Fluxo de pagamento PrestaShop\",\"formul\u00e1rio de pagamento incorporado\",\"Gateway de pagamento personalizado PrestaShop\",\"Gateway de pagamento PrestaShop\",\"Integra\u00e7\u00e3o da API do PrestaShop\",\"integra\u00e7\u00e3o de API de gateway de pagamento\",\"integra\u00e7\u00e3o de pagamento personalizada\",\"Integra\u00e7\u00e3o de pagamento PrestaShop\",\"Integra\u00e7\u00e3o do gateway de pagamento PrestaShop\",\"Integra\u00e7\u00e3o do gateway PrestaShop\",\"M\u00e9todos de pagamento PrestaShop\",\"M\u00f3dulo de pagamento personalizado para PrestaShop\",\"M\u00f3dulo de pagamento PrestaShop\",\"Op\u00e7\u00f5es de pagamento do PrestaShop\",\"Pagamento PrestaShop\",\"Pagamento PrestaShop iframe\",\"PayU PrestaShop\",\"Personaliza\u00e7\u00e3o do checkout do PrestaShop\",\"PrestaShop API integration\",\"PrestaShop OPC\",\"Prestashop Verifica\u00e7\u00e3o de uma p\u00e1gina\",\"Prestashop Verifica\u00e7\u00e3o de uma p\u00e1gina\",\"Processamento de pagamentos PrestaShop\",\"Seguran\u00e7a de pagamento PrestaShop\",\"SimplyLease PrestaShop\",\"Solu\u00e7\u00e3o de problemas de pagamento no PrestaShop\",\"Status do pedido PrestaShop\",\"SuperCheckout PrestaShop\",\"webhooks de gateway de pagamento\",\"Webhooks do PrestaShop\"],\"articleSection\":[\"E-commerce\",\"Ecommerce\",\"Prestashop\",\"Sin categorizar\"],\"inLanguage\":\"pt-BR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/pt-br\\\/ecommerce-blog\\\/prestashop-payment-gateway-integration\\\/\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/pt-br\\\/ecommerce-blog\\\/prestashop-payment-gateway-integration\\\/\",\"name\":\"Integra\u00e7\u00e3o de Gateway de Pagamento no PrestaShop: Guia de API e OPC\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/pt-br\\\/ecommerce-blog\\\/prestashop-payment-gateway-integration\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/pt-br\\\/ecommerce-blog\\\/prestashop-payment-gateway-integration\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/Portuguese-1.jpg\",\"datePublished\":\"2026-09-09T12:21:13+00:00\",\"dateModified\":\"2026-09-15T06:36:01+00:00\",\"description\":\"Aprenda a integrar um gateway de pagamento personalizado ao PrestaShop, lidar com APIs, webhooks e estados de pedido, al\u00e9m de solucionar problemas de compatibilidade com o OPC.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/pt-br\\\/ecommerce-blog\\\/prestashop-payment-gateway-integration\\\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.knowband.com\\\/blog\\\/pt-br\\\/ecommerce-blog\\\/prestashop-payment-gateway-integration\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/pt-br\\\/ecommerce-blog\\\/prestashop-payment-gateway-integration\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/Portuguese-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/Portuguese-1.jpg\",\"width\":760,\"height\":300,\"caption\":\"Compreendendo a integra\u00e7\u00e3o de gateways de pagamento personalizados e a compatibilidade com OPC no PrestaShop\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/pt-br\\\/ecommerce-blog\\\/prestashop-payment-gateway-integration\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Integra\u00e7\u00e3o de um gateway de pagamento personalizado no PrestaShop: Requisitos t\u00e9cnicos, fluxo da API e desafios reais do OPC\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#website\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/\",\"name\":\"Knowband Blog | Ecommerce Modules\",\"description\":\"Magento, Prestashop, Opencart, Shopify\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#organization\",\"name\":\"Knowband Blog | Ecommerce Modules\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/cropped-knowband_logo-v2.png\",\"contentUrl\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/cropped-knowband_logo-v2.png\",\"width\":153,\"height\":61,\"caption\":\"Knowband Blog | Ecommerce Modules\"},\"image\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Knowband\",\"https:\\\/\\\/x.com\\\/KnowbandPlugin\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#\\\/schema\\\/person\\\/ca485d026e41cbf45ae99b67d0c9ac74\",\"name\":\"Sophie\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/plugins\\\/wp-user-avatar\\\/deprecated\\\/wp-user-avatar\\\/images\\\/wpua-96x96.png\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/plugins\\\/wp-user-avatar\\\/deprecated\\\/wp-user-avatar\\\/images\\\/wpua-96x96.png\",\"contentUrl\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/plugins\\\/wp-user-avatar\\\/deprecated\\\/wp-user-avatar\\\/images\\\/wpua-96x96.png\",\"caption\":\"Sophie\"},\"description\":\"We are experts in the eCommerce industry, specializing in high-quality plugin development. With years of experience, we deliver reliable and feature-rich modules for platforms such as Magento, PrestaShop, OpenCart, and Shopify. In addition to ready-made plugins, we also provide custom module development and tailored modification services to meet unique business needs. Our team stays ahead of industry trends, ensuring every solution we build enhances store performance, user experience, and overall functionality. With a strong customer-centric approach, we have become a trusted partner for businesses seeking powerful and scalable eCommerce plugin solutions.\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/pt-br\\\/author\\\/titiksha-dwivedi\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Integra\u00e7\u00e3o de Gateway de Pagamento no PrestaShop: Guia de API e OPC","description":"Aprenda a integrar um gateway de pagamento personalizado ao PrestaShop, lidar com APIs, webhooks e estados de pedido, al\u00e9m de solucionar problemas de compatibilidade com o OPC.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.knowband.com\/blog\/pt-br\/ecommerce-blog\/prestashop-payment-gateway-integration\/","og_locale":"pt_BR","og_type":"article","og_title":"Integra\u00e7\u00e3o de Gateway de Pagamento no PrestaShop: Guia de API e OPC","og_description":"Aprenda a integrar um gateway de pagamento personalizado ao PrestaShop, lidar com APIs, webhooks e estados de pedido, al\u00e9m de solucionar problemas de compatibilidade com o OPC.","og_url":"https:\/\/www.knowband.com\/blog\/pt-br\/ecommerce-blog\/prestashop-payment-gateway-integration\/","og_site_name":"Knowband Blog | Ecommerce Modules","article_publisher":"https:\/\/www.facebook.com\/Knowband","article_published_time":"2026-09-09T12:21:13+00:00","article_modified_time":"2026-09-15T06:36:01+00:00","og_image":[{"width":760,"height":300,"url":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2026\/09\/Portuguese-1.jpg","type":"image\/jpeg"}],"author":"Sophie","twitter_card":"summary_large_image","twitter_creator":"@KnowbandPlugin","twitter_site":"@KnowbandPlugin","twitter_misc":{"Written by":"Sophie","Est. reading time":"18 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.knowband.com\/blog\/pt-br\/ecommerce-blog\/prestashop-payment-gateway-integration\/#article","isPartOf":{"@id":"https:\/\/www.knowband.com\/blog\/pt-br\/ecommerce-blog\/prestashop-payment-gateway-integration\/"},"author":{"name":"Sophie","@id":"https:\/\/www.knowband.com\/blog\/fr\/#\/schema\/person\/ca485d026e41cbf45ae99b67d0c9ac74"},"headline":"Integra\u00e7\u00e3o de um gateway de pagamento personalizado no PrestaShop: Requisitos t\u00e9cnicos, fluxo da API e desafios reais do OPC","datePublished":"2026-09-09T12:21:13+00:00","dateModified":"2026-09-15T06:36:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.knowband.com\/blog\/pt-br\/ecommerce-blog\/prestashop-payment-gateway-integration\/"},"wordCount":4423,"publisher":{"@id":"https:\/\/www.knowband.com\/blog\/fr\/#organization"},"image":{"@id":"https:\/\/www.knowband.com\/blog\/pt-br\/ecommerce-blog\/prestashop-payment-gateway-integration\/#primaryimage"},"thumbnailUrl":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2026\/09\/Portuguese-1.jpg","keywords":["API de pagamento PrestaShop","BLIK PrestaShop","Checkout AJAX do PrestaShop","Checkout em JavaScript do PrestaShop","Comfino PrestaShop","compatibilidade com gateways de pagamento","Compatibilidade de pagamento com PrestaShop","Cria\u00e7\u00e3o de pedidos PrestaShop","Desenvolvimento de pagamentos PrestaShop","Enviar clave de servicio web de forma segura","Fluxo de pagamento PrestaShop","formul\u00e1rio de pagamento incorporado","Gateway de pagamento personalizado PrestaShop","Gateway de pagamento PrestaShop","Integra\u00e7\u00e3o da API do PrestaShop","integra\u00e7\u00e3o de API de gateway de pagamento","integra\u00e7\u00e3o de pagamento personalizada","Integra\u00e7\u00e3o de pagamento PrestaShop","Integra\u00e7\u00e3o do gateway de pagamento PrestaShop","Integra\u00e7\u00e3o do gateway PrestaShop","M\u00e9todos de pagamento PrestaShop","M\u00f3dulo de pagamento personalizado para PrestaShop","M\u00f3dulo de pagamento PrestaShop","Op\u00e7\u00f5es de pagamento do PrestaShop","Pagamento PrestaShop","Pagamento PrestaShop iframe","PayU PrestaShop","Personaliza\u00e7\u00e3o do checkout do PrestaShop","PrestaShop API integration","PrestaShop OPC","Prestashop Verifica\u00e7\u00e3o de uma p\u00e1gina","Prestashop Verifica\u00e7\u00e3o de uma p\u00e1gina","Processamento de pagamentos PrestaShop","Seguran\u00e7a de pagamento PrestaShop","SimplyLease PrestaShop","Solu\u00e7\u00e3o de problemas de pagamento no PrestaShop","Status do pedido PrestaShop","SuperCheckout PrestaShop","webhooks de gateway de pagamento","Webhooks do PrestaShop"],"articleSection":["E-commerce","Ecommerce","Prestashop","Sin categorizar"],"inLanguage":"pt-BR"},{"@type":"WebPage","@id":"https:\/\/www.knowband.com\/blog\/pt-br\/ecommerce-blog\/prestashop-payment-gateway-integration\/","url":"https:\/\/www.knowband.com\/blog\/pt-br\/ecommerce-blog\/prestashop-payment-gateway-integration\/","name":"Integra\u00e7\u00e3o de Gateway de Pagamento no PrestaShop: Guia de API e OPC","isPartOf":{"@id":"https:\/\/www.knowband.com\/blog\/fr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.knowband.com\/blog\/pt-br\/ecommerce-blog\/prestashop-payment-gateway-integration\/#primaryimage"},"image":{"@id":"https:\/\/www.knowband.com\/blog\/pt-br\/ecommerce-blog\/prestashop-payment-gateway-integration\/#primaryimage"},"thumbnailUrl":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2026\/09\/Portuguese-1.jpg","datePublished":"2026-09-09T12:21:13+00:00","dateModified":"2026-09-15T06:36:01+00:00","description":"Aprenda a integrar um gateway de pagamento personalizado ao PrestaShop, lidar com APIs, webhooks e estados de pedido, al\u00e9m de solucionar problemas de compatibilidade com o OPC.","breadcrumb":{"@id":"https:\/\/www.knowband.com\/blog\/pt-br\/ecommerce-blog\/prestashop-payment-gateway-integration\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.knowband.com\/blog\/pt-br\/ecommerce-blog\/prestashop-payment-gateway-integration\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.knowband.com\/blog\/pt-br\/ecommerce-blog\/prestashop-payment-gateway-integration\/#primaryimage","url":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2026\/09\/Portuguese-1.jpg","contentUrl":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2026\/09\/Portuguese-1.jpg","width":760,"height":300,"caption":"Compreendendo a integra\u00e7\u00e3o de gateways de pagamento personalizados e a compatibilidade com OPC no PrestaShop"},{"@type":"BreadcrumbList","@id":"https:\/\/www.knowband.com\/blog\/pt-br\/ecommerce-blog\/prestashop-payment-gateway-integration\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.knowband.com\/blog\/fr\/"},{"@type":"ListItem","position":2,"name":"Integra\u00e7\u00e3o de um gateway de pagamento personalizado no PrestaShop: Requisitos t\u00e9cnicos, fluxo da API e desafios reais do OPC"}]},{"@type":"WebSite","@id":"https:\/\/www.knowband.com\/blog\/fr\/#website","url":"https:\/\/www.knowband.com\/blog\/fr\/","name":"Knowband Blog | Ecommerce Modules","description":"Magento, Prestashop, Opencart, Shopify","publisher":{"@id":"https:\/\/www.knowband.com\/blog\/fr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.knowband.com\/blog\/fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Organization","@id":"https:\/\/www.knowband.com\/blog\/fr\/#organization","name":"Knowband Blog | Ecommerce Modules","url":"https:\/\/www.knowband.com\/blog\/fr\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.knowband.com\/blog\/fr\/#\/schema\/logo\/image\/","url":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2016\/09\/cropped-knowband_logo-v2.png","contentUrl":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2016\/09\/cropped-knowband_logo-v2.png","width":153,"height":61,"caption":"Knowband Blog | Ecommerce Modules"},"image":{"@id":"https:\/\/www.knowband.com\/blog\/fr\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Knowband","https:\/\/x.com\/KnowbandPlugin"]},{"@type":"Person","@id":"https:\/\/www.knowband.com\/blog\/fr\/#\/schema\/person\/ca485d026e41cbf45ae99b67d0c9ac74","name":"Sophie","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.knowband.com\/blog\/wp-content\/plugins\/wp-user-avatar\/deprecated\/wp-user-avatar\/images\/wpua-96x96.png","url":"https:\/\/www.knowband.com\/blog\/wp-content\/plugins\/wp-user-avatar\/deprecated\/wp-user-avatar\/images\/wpua-96x96.png","contentUrl":"https:\/\/www.knowband.com\/blog\/wp-content\/plugins\/wp-user-avatar\/deprecated\/wp-user-avatar\/images\/wpua-96x96.png","caption":"Sophie"},"description":"We are experts in the eCommerce industry, specializing in high-quality plugin development. With years of experience, we deliver reliable and feature-rich modules for platforms such as Magento, PrestaShop, OpenCart, and Shopify. In addition to ready-made plugins, we also provide custom module development and tailored modification services to meet unique business needs. Our team stays ahead of industry trends, ensuring every solution we build enhances store performance, user experience, and overall functionality. With a strong customer-centric approach, we have become a trusted partner for businesses seeking powerful and scalable eCommerce plugin solutions.","url":"https:\/\/www.knowband.com\/blog\/pt-br\/author\/titiksha-dwivedi\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.knowband.com\/blog\/pt-br\/wp-json\/wp\/v2\/posts\/841324","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.knowband.com\/blog\/pt-br\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.knowband.com\/blog\/pt-br\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/pt-br\/wp-json\/wp\/v2\/users\/43"}],"replies":[{"embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/pt-br\/wp-json\/wp\/v2\/comments?post=841324"}],"version-history":[{"count":3,"href":"https:\/\/www.knowband.com\/blog\/pt-br\/wp-json\/wp\/v2\/posts\/841324\/revisions"}],"predecessor-version":[{"id":841476,"href":"https:\/\/www.knowband.com\/blog\/pt-br\/wp-json\/wp\/v2\/posts\/841324\/revisions\/841476"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/pt-br\/wp-json\/wp\/v2\/media\/841342"}],"wp:attachment":[{"href":"https:\/\/www.knowband.com\/blog\/pt-br\/wp-json\/wp\/v2\/media?parent=841324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/pt-br\/wp-json\/wp\/v2\/categories?post=841324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/pt-br\/wp-json\/wp\/v2\/tags?post=841324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}