duanping1920 2016-02-12 03:38
浏览 62
已采纳

Neteller API REST API问题

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?

  • 写回答

1条回答 默认 最新

  • dousou1878 2016-04-20 13:07
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器