在我的Xubuntu 16.04(作曲家需要coinbase / coinbase)上干净安装Coinbase API for PHP后,我按照Coinbase文档并使用以下命令访问我的钱包:
<?php
require 'vendor/autoload.php';
use Coinbase\Wallet\Client;
use Coinbase\Wallet\Configuration;
$apiKey = '********';
$apiSecret = '*********';
$configuration = Configuration::apiKey($apiKey, $apiSecret);
$client = Client::create($configuration);
$accounts = $client->getAccounts();
...
...
函数getAccounts始终返回:
PHP Notice: Undefined index: pagination in /home/willem/coinbase/vendor/coinbase/coinbase/src/Mapper.php on line 490
PHP Stack trace:
PHP 1. {main}() /home/willem/coinbase/newfile.php:0
PHP 2. Coinbase\Wallet\Client->getAccounts() /home/willem/coinbase/newfile.php:14
PHP 3. Coinbase\Wallet\Client->getAndMapCollection() /home/willem/coinbase/vendor/coinbase/coinbase/src/Client.php:215
PHP 4. Coinbase\Wallet\Mapper->toAccounts() /home/willem/coinbase/vendor/coinbase/coinbase/src/Client.php:834
PHP 5. Coinbase\Wallet\Mapper->toCollection() /home/willem/coinbase/vendor/coinbase/coinbase/src/Mapper.php:59
PHP Notice: Undefined index: pagination in /home/willem/coinbase/vendor/coinbase/coinbase/src/Mapper.php on line 491
PHP Stack trace:
PHP 1. {main}() /home/willem/coinbase/newfile.php:0
PHP 2. Coinbase\Wallet\Client->getAccounts() /home/willem/coinbase/newfile.php:14
PHP 3. Coinbase\Wallet\Client->getAndMapCollection() /home/willem/coinbase/vendor/coinbase/coinbase/src/Client.php:215
PHP 4. Coinbase\Wallet\Mapper->toAccounts() /home/willem/coinbase/vendor/coinbase/coinbase/src/Client.php:834
PHP 5. Coinbase\Wallet\Mapper->toCollection() /home/willem/coinbase/vendor/coinbase/coinbase/src/Mapper.php:59
尽管有错误,但帐户信息会被检索到$ accounts中
显然我现在使用2&gt; / dev / null但我宁愿不这样做
任何解决方案都非常感谢!
答案 0 :(得分:0)
根据Alex的评论,建议的代码行确实会抑制“#notice”。 我又是一个快乐的程序员:)