Fix getInvoice.php tutorial

This commit is contained in:
kakaska 2019-02-25 19:00:35 +01:00
parent c25d3d3c99
commit 8b3f1663f1

View File

@ -15,13 +15,19 @@ require __DIR__.'/../../vendor/autoload.php';
// Now fetch the invoice from BitPay
$storageEngine = new \Bitpay\Storage\EncryptedFilesystemStorage('YourTopSecretPassword');
$privateKey = $storageEngine->load('/tmp/bitpay.pri');
$publicKey = $storageEngine->load('/tmp/bitpay.pub');
$client = new \Bitpay\Client\Client();
$adapter = new \Bitpay\Client\Adapter\CurlAdapter();
$client->setPrivateKey($privateKey);
$client->setPublicKey($publicKey);
$client->setUri('https://btcpay.server/');
$client->setAdapter($adapter);
$token = new \Bitpay\Token();
$token->setToken('UpdateThisValue'); // UPDATE THIS VALUE
$token->setFacade('merchant');
$client->setToken($token);