0

I was just messing around with the coinbase api, and am getting an error. Basically I was saying if the transaction was successful, then just simply echo the information (like transaction id), but I get an error: http://puu.sh/4onKP.png Here is the most important parts of my code...

$result = $coinbase->sendMoney($address, $amount, "Thank you for using nahtnam's Faucet! - Best Regards, nahtnam");
$address_success = $response->success ? 'true' : 'false';
$address_status = $response->transaction->status;
$address_id = $response->transaction->id;
$address_amount = $response->transaction->amount->amount;

And also here is where i display the information...

elseif(isset($response['success']) && $response['success'] == 'true') {
    echo '
    <div class="row">
    <div class="col-lg-12">
    <center>
    <div class="alert alert-dismissable alert-success">
    <button type="button" class="close" data-dismiss="alert">&times;</button>
    <strong>Your Bitcoins have been sent!</strong><br>We have successfully sent '.$amount.' to your Bitcoin Address: '.$address.'... Here is some more info on the transaction:<br>Address: '.$address.'<br> Amount: '.$amount.'<br>Transaction Id: '.$address_id.'<br> Transaction Status: '.$address_status.'<br>Thank you for using nahtnam\'s Coinbase faucet. You can come back in <strong>30 Minutes</strong> to claim more!</a>.
    </div>
    </center>
    </div>
    </div>
    ';
    }

Thanks for all the help! :)

4

1 回答 1

-1

首先,您的 sendMoney() 调用存储在 $result 中,并且您正在引用一个名为 $response 的对象,该对象基于错误不存在。

于 2013-09-11T03:54:36.780 回答