So, I am trying to use the coinbase API. I'm attempting a simple test to see if I can make it work, but I'm getting various composer errors.
Currently, I am getting unexpected t 'use' for this code:
use Coinbase\Wallet\Client;
use Coinbase\Wallet\Configuration;
$apiKey = 'public';
$apiSecret = 'private';
$configuration = Configuration::apiKey($apiKey, $apiSecret);
$client = Client::create($configuration);
$spotPrice = $client->getSpotPrice();
echo $spotPrice;
So, are my use statements in the wrong place? Ive tried them outside the index function and outside the class. Both yield completely different sets of results than this.
Outside of the Keks class, I get
Fatal error: Class 'Coinbase\Wallet\Configuration' not found in /home/content/61/11420661/html/beta/application/controllers/keks.php on line 15
And inside the class but outside the index() function I get
Fatal error: Trait 'Coinbase\Wallet\Client' not found in >/home/content/61/11420661/html/beta/application/controllers/keks.php on line 4
Is there something wrong in my composer.json maybe?
The full controller is here: http://pastebin.com/4BjPP6YR
<?php echo phpversion();
– Sniggle<?php echo phpversion();
to get the version. – Sniggleparse error: syntax error, unexpected 'use' (T_USE)
or is it something else? (If it is: what is before the code snippet you've posted?) – Sniggle