我試圖創建一個按鈕併爲coinbase指定一個回調URL。Coinbase按鈕的創建和回調
我在嘗試發佈到coinbase API時收到了一些CAPTCHA數據。
我想我的虛擬主機被CloudFlare阻止,禁用我的代碼。
這是我有:
<a class="coinbase-button" data-code="<?php
$data = array(
"button" => array(
"name" => "Ticket",
"price_string" => "0.01",
"price_currency_iso" => "BTC",
"custom" => $OrderNext . "- " . $ticket,
"callback_url" => "https://x.com/callback.php",
"description" => "Ticket - " . $ticket ,
"type" => "buy_now",
"style" => "buy_now_large"
)
);
$json_data = json_encode($data);
$ch = curl_init("https://coinbase.com/api/v1/buttons?api_key=xxxxxxxxxxxxxxxxxxxxxx");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json_data))
);
if(! $output = curl_exec($ch))
{
trigger_error(curl_error($ch));
}
$result = json_decode($output);
$output
返回一個驗證碼圖片頁面。
$result
爲空。
感謝您的任何幫助。
$輸出看起來像這樣當我回聲:http://s10.postimg.org/3pll2rt1l/Cloud_Flare_error.jpg –