I'm using the pagseguro API to make purchases on my site, it was working fine, normally. Today when I went to use again it started to present this error:
Not Found
The requested URL /admin/usuario/
Fatal error: Uncaught exception 'Exception' with message 'CURL can't connect: Protocol https not supported or disabled in libcurl' in /home/onecom/public_html/admin/PagSeguroLibrary/utils/PagSeguroHttpConnection.class.php:120Stack trace: was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
My Token and configured email are correct, but I do not know what it can be. The code I'm using:
<?php
require_once "../PagSeguroLibrary/PagSeguroLibrary.php";
class CreatePaymentRequest
{
public static function main()
{
$paymentRequest = new PagSeguroPaymentRequest();
$paymentRequest->setCurrency("BRL");
$paymentRequest->addItem('0001', 'notebook', 2, 430.00);
$paymentRequest->addItem('0002', 'notebook 2', 2, 560.00);
$paymentRequest->setReference("REF123");
$paymentRequest->setRedirectUrl("http://www.lojamodelo.com.br");
try {
$credentials = new PagSeguroAccountCredentials("[email protected]","MEU-TOKEN");
$url = $paymentRequest->register($credentials);
self::printPaymentUrl($url);
} catch (PagSeguroServiceException $e) {
die($e->getMessage());
}
}
public static function printPaymentUrl($url)
{
if ($url) {
echo "<h2>Criando requisição de pagamento</h2>";
echo "<p>URL do pagamento: <strong>$url</strong></p>";
echo "<p><a title=\"URL do pagamento\" href=\"$url\">Ir para URL do pagamento.</a></p>";
}
}
}
CreatePaymentRequest::main();
?>