-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcurlEstranho.php
31 lines (25 loc) · 1.11 KB
/
curlEstranho.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
$credenciais['email'] ="[email protected]";
$credenciais['token'] = "D29BDF43177840C89EFA6CFF6C0F7180";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://ws.sandbox.pagseguro.uol.com.br/v2/sessions');
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($credenciais));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$result = trim(curl_exec($curl));
var_dump($result);
curl_close($curl);
/*$dados = array("email"=>[email protected], "token"=>D29BDF43177840C89EFA6CFF6C0F7180);
$url = "https://ws.sandbox.pagseguro.uol.com.br/v2/sessions";
//inicia o CURL
$ch = curl_init();
//seta os parametros
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $dados);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$ch_result = curl_exec($ch);
curl_close($ch);*/
?>