1
Opa
I am generating the payment via pagseguro and storing your transaction code for later consultation. In the transaction query, by the transaction code I am doing so:
$email_pagseguro = '[email protected]';
$token_pagseguro = '****************************';
$url = 'https://ws.pagseguro.uol.com.br/v2/transactions/'.$tabela_itens['usuario_checkout_transactionCode'].'?email='.$email_pagseguro.'&token='.$token_pagseguro;
$_h = curl_init();
//curl_setopt($_h, CURLOPT_HEADER, 1);
curl_setopt($_h, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($_h, CURLOPT_HTTPGET, 1);
curl_setopt($_h, CURLOPT_URL, $url );
curl_setopt($_h, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt($_h, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($_h, CURLOPT_DNS_USE_GLOBAL_CACHE, false );
curl_setopt($_h, CURLOPT_DNS_CACHE_TIMEOUT, 2 );
$output = curl_exec($_h);
var_dump($output);
//$transaction = simplexml_load_string($output);
var_dump is returning a text with all the transaction data, a string, where I believe an xml should be returned.
Put the comeback.
– Marcelo de Andrade
what is this text that is returning? wouldn’t be xml?
– Neuber Oliveira
Solved it, added the
curl_setopt($_h, CURLOPT_HTTPHEADER, Array("Content-Type: application/xml; charset=ISO-8859-1"));
– sNniffer
The return was being a string
– sNniffer