This example below is not working.
https://github.com/bitpay/php-bitpay-client/blob/v2.2.20/examples/GetTokens.php
$bitpay = new \Bitpay\Bitpay(
array(
'bitpay' => array(
'network' => 'testnet', // testnet or livenet, default is livenet
'public_key' => '/tmp/bitpay.pub', //see tutorial/001.php and 002.php
'private_key' => '/tmp/bitpay.pri',
'key_storage' => 'Bitpay\Storage\EncryptedFilesystemStorage',
'key_storage_password' => 'xxNxx'
)
)
);
/**
* Create the client that will be used to send requests to BitPay's API
*/
$client = $bitpay->get('client');
$tokens = $client->getTokens();
PHP Fatal error: Uncaught Exception: The private key must be in hex format. in /home/hu/web/btcwallet/bitpay/vendor/bitpay/php-client/src/Bitpay/PrivateKey.php:127
Stack trace:
#0 /home/hu/web/btcwallet/bitpay/vendor/bitpay/php-client/src/Bitpay/Client/Client.php(663): Bitpay\PrivateKey->sign('https://test.bi...')
#1 /home/hu/web/btcwallet/bitpay/vendor/bitpay/php-client/src/Bitpay/Client/Client.php(489): Bitpay\Client\Client->addSignatureHeader(Object(Bitpay\Client\Request))
#2 /home/hu/web/btcwallet/bitpay/test.php(36): Bitpay\Client\Client->getTokens()
#3 {main}
thrown in /home/hu/web/btcwallet/bitpay/vendor/bitpay/php-client/src/Bitpay/PrivateKey.php on line 127
php version: PHP 7.1.3 bitpay/php-client: 2.2.20
This example below is not working.
https://github.com/bitpay/php-bitpay-client/blob/v2.2.20/examples/GetTokens.php