How to get property of non object in Coinbase API

0 votes

Here is 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>
    ';
    }

This is not working though, I keep getting errors

Aug 31, 2018 in Blockchain by slayer
• 29,370 points

retagged Nov 22, 2018 by Kalgi 756 views

1 answer to this question.

0 votes

First, your sendMoney() call is stored into $result and you are referencing an object called $response, which doesn't exist.

answered Aug 31, 2018 by digger
• 26,740 points

Related Questions In Blockchain

0 votes
1 answer

In a non-cryptocurrency implementation of Blockchain, how to successfully mine a node?

Difficulty is a property of the blockchain, ...READ MORE

answered Jul 13, 2018 in Blockchain by Perry
• 17,100 points
524 views
0 votes
1 answer

How to track changes of an object in exonum?

You have to describe each component in ...READ MORE

answered Jul 23, 2018 in Blockchain by slayer
• 29,370 points
633 views
0 votes
1 answer

How to get amount of bitcoins in php?

I’ve tried this code and it works: <?php function ...READ MORE

answered Aug 24, 2018 in Blockchain by slayer
• 29,370 points
1,031 views
0 votes
1 answer

How to get the number of tokens in the Bitcoin network?

This information can easily be calculated by ...READ MORE

answered Aug 31, 2018 in Blockchain by Christine
• 15,790 points
1,157 views
+1 vote
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,460 points
1,428 views
0 votes
1 answer

403 forbidden error coinbase api

I had a similiar issue connecting this API, ...READ MORE

answered Aug 28, 2018 in Blockchain by digger
• 26,740 points
2,638 views
0 votes
1 answer

Required parameter missing: account error

You need to swap out the place ...READ MORE

answered Aug 30, 2018 in Blockchain by slayer
• 29,370 points
1,543 views
0 votes
1 answer

com.coinbase.api.exc­eption.UnauthorizedE­xception

Start by creating a new OAuth 2.0 ...READ MORE

answered Sep 5, 2018 in Blockchain by digger
• 26,740 points
1,024 views
0 votes
2 answers

how to integrate coinbase api in php for transfer bitcoine

Here the code for php please have ...READ MORE

answered Sep 17, 2018 in Blockchain by Suresh
3,136 views
0 votes
1 answer

how to get modification history of asset?

You can use GetHistoryForKey() API as shown ...READ MORE

answered Jul 9, 2018 in Blockchain by digger
• 26,740 points
1,477 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP