Long story short, I'm trying to connect to PayPal sandbox API ,it's getting a response without errors
my issue is it's printing the response without specifying it for some reason, I don't know where that response is stored, it's just inserted automatically in the page
code :
[CONTENT HERE]
$paypal_api_sandbox = 'https://api-m.sandbox.paypal.com/v1/oauth2/token';
$curl = curl_init($paypal_api_sandbox);
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($curl,CURLOPT_POSTFIELDS,'grant_type=client_credentials');
curl_setopt($curl , CURLOPT_USERPWD ,'USER:PASS');
$res = curl_exec($curl);
[CONTENT HERE]
fields are :
USER - My client id
PASS - secret key
print_r($res) // returns 1
Full output :
[CONTENT]
['content':'PayPal response printed automatically on the page']
[CONTENT]
1
Where's the leak ?