- 06 Abr 2017, 13:38
#72849
Quando eu seleciono pagamento no cartão de crédito ou débito aparece o erro abaixo e quando seleciono pagamento no boleto ele mostra que o boleto está sendo gerado e nunca gera.
Fatal error: Uncaught exception 'Exception' with message 'PagSeguro Transparente: API Request Error: 401' in /home/sojaracoes/public_html/teste/catalog/controller/payment/pagseguro_credit_card.php:185 Stack trace: #0 /home/sojaracoes/public_html/teste/catalog/controller/payment/pagseguro_credit_card.php(48): ControllerPaymentPagseguroCreditCard->getSessionId(Object(PagSeguroData)) #1 /home/sojaracoes/public_html/teste/vqmod/vqcache/vq2-system_engine_controller.php(60): ControllerPaymentPagseguroCreditCard->index(Array) #2 /home/sojaracoes/public_html/teste/catalog/controller/checkout/confirm.php(392): Controller->getChild('payment/pagsegu...') #3 [internal function]: ControllerCheckoutConfirm->index() #4 /home/sojaracoes/public_html/teste/vqmod/vqcache/vq2-system_engine_front.php(46): call_user_func_array(Array, Array) #5 /home/sojaracoes/public_html/teste/vqmod/vqcache/vq2-system_engine_front.php(33): Front->execute(Object(Action)) #6 /home/sojaracoes/public_html/teste/index.php(249): Front->dispatch(Object(Action), Obje in /home/sojaracoes/public_html/teste/catalog/controller/payment/pagseguro_credit_card.php on line 185
Fatal error: Uncaught exception 'Exception' with message 'PagSeguro Transparente: API Request Error: 401' in /home/sojaracoes/public_html/teste/catalog/controller/payment/pagseguro_credit_card.php:185 Stack trace: #0 /home/sojaracoes/public_html/teste/catalog/controller/payment/pagseguro_credit_card.php(48): ControllerPaymentPagseguroCreditCard->getSessionId(Object(PagSeguroData)) #1 /home/sojaracoes/public_html/teste/vqmod/vqcache/vq2-system_engine_controller.php(60): ControllerPaymentPagseguroCreditCard->index(Array) #2 /home/sojaracoes/public_html/teste/catalog/controller/checkout/confirm.php(392): Controller->getChild('payment/pagsegu...') #3 [internal function]: ControllerCheckoutConfirm->index() #4 /home/sojaracoes/public_html/teste/vqmod/vqcache/vq2-system_engine_front.php(46): call_user_func_array(Array, Array) #5 /home/sojaracoes/public_html/teste/vqmod/vqcache/vq2-system_engine_front.php(33): Front->execute(Object(Action)) #6 /home/sojaracoes/public_html/teste/index.php(249): Front->dispatch(Object(Action), Obje in /home/sojaracoes/public_html/teste/catalog/controller/payment/pagseguro_credit_card.php on line 185
Código: Selecionar todos
private function getSessionId(PagSeguroData $pagSeguroData)
{
// Creating a http connection (CURL abstraction)
$httpConnection = new PagSeguroHttpConnection();
// Request to PagSeguro Session API using Credentials
$httpConnection->post($pagSeguroData->getSessionURL(), $pagSeguroData->getCredentials());
// Request OK getting the result
if ($httpConnection->getStatus() === 200) {
$data = $httpConnection->getResponse();
$sessionId = $this->parseSessionIdFromXml($data);
return $sessionId;
} else {
throw new Exception("PagSeguro Transparente: API Request Error: " . $httpConnection->getStatus());
}
}