Página 1 de 1
Erro Arquivo de LOG - PagSeguro
Enviado: 28 Set 2014, 15:31
por slofrj
Boa Tarde amigos,
Alguém poderia me dar uma ajuda com este log de erros:
2014-09-28 0:37:00 - PHP Notice: Undefined index: pt-br in /home/ofert831/public_html/loja/catalog/controller/payment/pagseguro.php on line 317
2014-09-28 2:07:17 - PHP Unknown: Argument 3 passed to PagSeguroHttpConnection::curlConnection() must be an array, null given, called in /home/ofert831/public_html/loja/system/library/PagSeguroLibrary/utils/PagSeguroHttpConnection.class.php on line 64 and defined in /home/ofert831/public_html/loja/system/library/PagSeguroLibrary/utils/PagSeguroHttpConnection.class.php on line 67
Instalei o módulo de pagamentos do próprio PagSeguro mas veio cheio de erros, então excluí arquivo por arquivo (pois o inconsequente aqui não fez o backup antes), e depois instalei um módulo que encontrei aqui no fórum.
Aparentemente tudo funciona bem. Já fiz um teste de venda e parece tudo ok, até mesmo com envio automático dos emails para o cliente.
Só o que me preocupa é este log de erros mencionando o PagSeguro.
Se alguém puder me dar uma orientação, agradeço muito.
Obrigado.
Re: Erro Arquivo de LOG - PagSeguro
Enviado: 28 Set 2014, 17:41
por Manoel Vidal
Qual o link que você baixou o módulo?
Re: Erro Arquivo de LOG - PagSeguro
Enviado: 28 Set 2014, 18:30
por slofrj
Estou usando o recomendado neste link...
http://www.opencart.com/index.php?route ... on_id=5983
Se não me engano foi o que você mesmo recomnedou.
Os outros erros já consegui administrar, mas este continua:
2014-09-28 21:22:38 - PHP Unknown: Argument 3 passed to PagSeguroHttpConnection::curlConnection() must be an array, null given, called in /home/ofert831/public_html/loja/system/library/PagSeguroLibrary/utils/PagSeguroHttpConnection.class.php on line 64 and defined in /home/ofert831/public_html/loja/system/library/PagSeguroLibrary/utils/PagSeguroHttpConnection.class.php on line 67
Re: Erro Arquivo de LOG - PagSeguro
Enviado: 28 Set 2014, 18:34
por slofrj
Segue código, caso possa verificar. Deixei observação nas linhas 64 e 67:
Código: Selecionar todos<?php
/*
* ***********************************************************************
Copyright [2011] [PagSeguro Internet Ltda.]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
* ***********************************************************************
*/
/**
* HTTP Connection Class - used in API calls (cURL library is required)
*/
class PagSeguroHttpConnection
{
private $status;
private $response;
public function __construct()
{
if (!function_exists('curl_init')) {
throw new Exception('PagSeguroLibrary: cURL library is required.');
}
}
public function getStatus()
{
return $this->status;
}
public function setStatus($status)
{
$this->status = $status;
}
public function getResponse()
{
return $this->response;
}
public function setResponse($response)
{
$this->response = $response;
}
public function post($url, array $data, $timeout = 5, $charset = 'ISO-8859-1')
{
return $this->curlConnection('POST', $url, $data, $timeout, $charset);
}
public function get($url, $timeout = 5, $charset = 'ISO-8859-1')
{
return $this->curlConnection('GET', $url, null, $timeout, $charset);
}
private function curlConnection($method, $url, array $data, $timeout, $charset)
{
if (strtoupper($method) === 'POST') {
$postFields = ($data ? http_build_query($data, '', '&') : "");
$contentLength = "Content-length: " . strlen($postFields);
$methodOptions = array(
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $postFields,
);
} else {
$contentLength = null;
$methodOptions = array(
CURLOPT_HTTPGET => true
);
}
$options = array(
CURLOPT_HTTPHEADER => array(
"Content-Type: application/x-www-form-urlencoded; charset=" . $charset,
$contentLength,
'lib-description: php:' . PagSeguroLibrary::getVersion()
),
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_CONNECTTIMEOUT => $timeout,
//CURLOPT_TIMEOUT => $timeout
);
// adding module version
if (!is_null(PagSeguroLibrary::getModuleVersion())) {
array_push($options[CURLOPT_HTTPHEADER], 'module-description: ' . PagSeguroLibrary::getModuleVersion());
}
// adding CMS version
if (!is_null(PagSeguroLibrary::getCMSVersion())) {
array_push($options[CURLOPT_HTTPHEADER], 'cms-description: ' . PagSeguroLibrary::getCMSVersion());
}
$options = ($options + $methodOptions);
$curl = curl_init();
curl_setopt_array($curl, $options);
$resp = curl_exec($curl);
$info = curl_getinfo($curl);
$error = curl_errno($curl);
$errorMessage = curl_error($curl);
curl_close($curl);
$this->setStatus((int) $info['http_code']);
$this->setResponse((String) $resp);
if ($error) {
throw new Exception("CURL can't connect: $errorMessage");
} else {
return true;
}
}
}
Re: Erro Arquivo de LOG - PagSeguro
Enviado: 28 Set 2014, 19:34
por Manoel Vidal
Altere a linha de código:
return $this->curlConnection('GET', $url, null, $timeout, $charset);
Para:
$data = array();
return $this->curlConnection('GET', $url, $data, $timeout, $charset);
Espero ter ajudado.

Re: Erro Arquivo de LOG - PagSeguro
Enviado: 28 Set 2014, 22:10
por slofrj
Boa Noite Manoel,
Ajudou muito sim.
Alterei a linha no código e o erro no log sumiu, mas por incrível que pareça apareceram 2 novas informações mas acho que não são nada de importante:
2014-09-29 1:02:45 - PagSeguro:
2014-09-29 1:03:05 - PagSeguro:
Como não vem o caminho ou uma informação propriamente de erro, acho que não devo me preocupar. Estou correto?
Uma outra ajuda que gostaria, caso não esteja lhe explorando muito é a respeito do "carrinho".
A página do opencart é muito ruim e mesmo com o tema da Lexus Store que adquiri não vi mudança.
Aparecem informações que considero desnecessárias, é longa, cansativa e no final não há um "botão" para o cliente confirmar o pedido, apenas um texto com link.
Será que vcê poderia me indicar uma extensão, gratuita, ou se não tiver de qualidade, uma paga mas via sistema nacional (em reais), onde seja uma página intertiva, bonita e fácil do cliente fazer os pedidos ?
Muitíssimo obrigado.
Re: Erro Arquivo de LOG - PagSeguro
Enviado: 28 Set 2014, 22:30
por Manoel Vidal
Infelizmente só conheço checkouts pagos e em dólares. :/
Re: Erro Arquivo de LOG - PagSeguro
Enviado: 28 Set 2014, 22:32
por slofrj
Entendi, mesmo assim poderia me indicar um, para eu analisar se terei condições de adquirir.
Obrigado