I'm trying to send cURL request to get response from payment service. The cURL request looks like:
curl -X POST https://secure.payu.com/pl/standard/user/oauth/authorize \
-d 'grant_type=client_credentials&client_id=CLIENTID&client_secret=CLIENTSECRET'
My code in Symfony is:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://secure.payu.com/pl/standard/user/oauth/authorize");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
http_build_query(array(
"grant_type" => "client_credentials",
"client_id" => $client_id,
"client_secret" => $client_secret
))
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch);
curl_close($ch);
var_dump($server_output);
But I always got false. What should I do to send curl request and get answer from payment service?