Secure Pay API to pick up payment status by ID

Asked

Viewed 996 times

1

Hello, I searched a lot about it looking at Pagseguro’s git but I couldn’t understand, what I want is the following

meusite.com/check.php? id=ID-DA-TRANSACTION-? token=MY-TOKEN? email=MY-EMAIL

Like if there is payment with transaction id placed on the link to the account and token it will return all the information (echo $info dar_dump?) of the payment, did not understand the Pagseguro API enough to do this so I came to ask for your help, thank you.

1 answer

3


Basically you’ll do it:

$curl=curl_init("https://ws.pagseguro.uol.com.br/v3/transactions/{{codigo-transacao}}?{{credenciais}}");
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
$xml=simplexml_load_string(curl_exec($curl));
curl_close($curl);
var_dump($xml);
  • transaction code = as it already suggests is that id you said, but only the id, without the id=

  • credentials = registered credentials email=SEU_EMAIL&token=SEU_TOKEN

  • example of the full url: https://ws.pagseguro.uol.com.br/v3/transactions/[email protected]&token=seu_token You search all transaction information.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.