区块链Wallet API付款问题

时间:2018-09-06 07:22:50

标签: php node.js blockchain blockchain.info-api

付款时,他们明确指出“所有请求的基本URL:https://blockchain.info/merchant/ $ guid /”。但是,当我将http://localhost:3000替换为基本url时,它什么也不返回。这是我发出请求的方式。

$base_url="https://blockchain.info/merchant/".$guid."/payment";
$parameters="password=".$firstpassword."&to=".$to."&amount=".$amount_in_satoshi;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $base_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    "Content-Type: application/x-www-form-urlencoded"
));
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);

它返回html并显示消息“ 301 Move Permanently”。这是其确切的响应信息

string(178) "<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
"

我尝试了另一种将所有钱包api github源代码放入heroku的方法,并尝试从那里运行它,但失败了。请纠正我我做错了的地方。任何帮助将非常感激。谢谢

0 个答案:

没有答案
相关问题