Error in the pagseguro module

-1

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&ccedil;&atilde;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();
?>
    
asked by anonymous 17.09.2014 / 22:36

1 answer

1

The error message says that the HTTPS protocol is not supported or is disabled in the cURL library of your server. You must have this library installed and active.

If it still does not work you should check with your hosting company if it is possible to enable or change hosts, as PagSeguro only works with secure URLs (https).

    
17.09.2014 / 22:43