1

I have an issue trying to implement Neteller's REST API. I have created my app in the merchant account (I don't have an SSL certificate in my site), I have a static IP for my web site and it is added to Neteller's allowed IP list, but for some reason I always receive a null response back from them.

This is my code:

$username = 'XXXXXXXXXXXXXXXX';
$password = 'XXxxxxxXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';

$curl = curl_init();

curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_URL, "https://api.neteller.com/v1/oauth2/token?grant_type=client_credentials");
curl_setopt($curl, CURLOPT_USERPWD, "$username:$password");
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type:application/json", "Cache-Control:no-cache"));
curl_setopt($curl, CURLOPT_POSTFIELDS, array("scope"=>"default"));
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

$serverOutput = curl_exec($curl);
$info = curl_getinfo($curl);

echo $serverOutput; // null response

Can anyone help me to solve this issue?

scrowler
  • 24,273
  • 9
  • 60
  • 92
Dante Cervantes
  • 323
  • 1
  • 3
  • 14
  • [This question might help you](http://stackoverflow.com/questions/18891030/how-to-develop-neteller-direct-api-with-php) – scrowler Feb 12 '16 at 03:52
  • Hello Robbie, i was using that, but for some reason, it stop working, and i receive an error saying that "curl cant connect to : https://api.neteller.com/netdirect". thanks for your quick answer – Dante Cervantes Feb 12 '16 at 04:26

1 Answers1

0

If you are receiving a null response to the curl_exec() method, this could indicate a problem establishing the HTTP connection.

try adding:

print_r(curl_errno($curl));

This will return the curl error code, which you can then check against this list.

Most probably it is a problem establishing the SSL connection - because the certificate issuing authority is not trusted by your cUrl installation. You can fix this by updating the trusted certificate authorities list. More info here.

Community
  • 1
  • 1
SimeonUzunov
  • 209
  • 1
  • 3