I'm having a hard time integrating a system with pagseguro using codeigniter.
I've already downloaded the official pagseguro library. link
I have already created a controller with all the data (in this case for a test);
function pagseguro(){
// $data['dados_pessoa'] = $this->cadastro_model->listar($this->session->userdata('uid'));
// $data['dados_pedido'] = $this->cadastro_model->listarpedidos($this->session->userdata('uid'));
require_once "PagSeguroLibrary/PagSeguroLibrary.php";
$paymentRequest = new PagSeguroPaymentRequest();
$paymentRequest->addItem('12345', 'Software', 1, 50.00);
$sedexCode = PagSeguroShippingType::getCodeByType('SEDEX');
$paymentRequest->setShippingType($sedexCode);
$paymentRequest->setShippingAddress(
'01452002',
'Av. x',
'1384',
'apto. x',
'Jardim x',
'São Paulo',
'SP',
'BRA'
);
$paymentRequest->setCurrency("BRL");
$paymentRequest->setReference('12345');
$paymentRequest->setRedirectUrl("http://meusite.com.br/pedidos");
$paymentRequest->addParameter('notificationURL', 'http://www.meusite.com.br/minhapagina');
try {
$credentials = PagseguroConfig::getAccountCredentials();
$checkoutUrl = $paymentRequest->register($credentials);
}
catch (PagseguroServiceException $e) {
die($e->getMessage());
}
}
It is the first time that I move with the pagseguro in framework and do not understand very well. The controller loads normally and no error appears! I would like to know how do I post to be able to send the data to the pagseguro!