我正在尝试找出以下代码在使用 Coinbase API 时哪里出错了。我安装了带有 Coinbase 依赖项的 Composer。以前我收到 Coinbase 类未安装的错误,我发现这是因为路径。我不再收到任何错误,但代码没有执行。任何人都可以帮忙吗?
<?php
require_once __DIR__ . '/usr/bin/vendor/autoload.php';
use coinbase\coinbase;
//I've tried to run it both with and without the following 3 lines of code with no difference
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$apiKey = 'XXX';
$apiSecret = 'XXX';
$configuration = Configuration::apiKey($apiKey, $apiSecret);
$client = Client::create($configuration);
$account = $client->getPrimaryAccount();
echo 'Account name: ' . $account->getName() . '<br>';
echo 'Account currency: ' . $account->getCurrency() . '<br>';
?>