2013-09-28 1 views
0

버튼 생성을위한 아래 코드가 있습니다.왜 coinbase 콜백 URL이 작동하지 않습니까?

public function createButton($name, $price, $currency, $custom=null, $options=array(),$callback) 
{ 
    // $callback=$this->generateReceiveAddress("http://www.tgigo.com"); 

    // print_r($callback);exit; 

    $params = array(
     "name" => $name, 
     "price_string" => $price, 
     "price_currency_iso" => $currency, 
     "callback_url"=>"http://www.tgigo.com" 
    ); 
    if($custom !== null) { 
     $params['custom'] = $custom; 
    } 
    foreach($options as $option => $value) { 
     $params[$option] = $value; 
    } 

    return $this->createButtonWithOptions($params); 
} 

public function createButtonWithOptions($options=array()) 
{ 

    $response = $this->post("buttons", array("button" => $options)); 

    if(!$response->success) { 
     return $response; 
    } 

    $returnValue = new stdClass(); 
    $returnValue->button = $response->button; 
    $returnValue->embedHtml = "<div class=\"coinbase-button\" data-code=\"" . $response->button->code . "\"></div><script src=\"https://coinbase.com/assets/button.js\" type=\"text/javascript\"></script>"; 
    $returnValue->success = true; 


    return $returnValue; 
} 

위의 코드에 대한 응답은 다음과 같습니다.

{ "성공": true "버튼": { "코드": "675cda22e31b314db557f0538f8ad27e", "유형": "buy_now", "스타일": "buy_now_large", "text": "Bitcoin으로 지불" "이름": "주문 번호 1234", "설명": "1 위젯 $ 100", "맞춤": "이 맞춤 주문 추적 코드", "callback_url": "http://www.tgigo.com", "가격" cents ": 100000,"currency_iso ":"BTC "}}}

이 코드 지불 프로세스를 사용했지만 콜백 URL로 리디렉션되지 않았습니다. 어느 누구든 제발 도와주세요. 사전에

감사합니다 :)

답변

관련 문제