1. Go to this page and download the library: Download seegno/bitreserve-sdk-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
seegno / bitreserve-sdk-php example snippets
use Uphold\UpholdClient as Client;
// Initialize the client.
$client = new Client(array(
'client_id' => 'APPLICATION_CLIENT_ID',
'client_secret' => 'APPLICATION_CLIENT_SECRET',
));
// Authorize user using the code parameter from the application redirect url.
$user = $client->authorizeUser('CODE');
// Get the Bearer token.
$bearer = $user->getClient()->getOption('bearer');
use Uphold\UpholdClient as Client;
// Initialize the client.
$client = new Client();
// Get user.
$user = $client->getUser('AUTHORIZATION_TOKEN');
use Uphold\UpholdClient as Client;
// Initialize the client.
$client = new Client();
// Get user.
$user = $client->getUser('AUTHORIZATION_TOKEN');
// Get user balances for all currencies.
$balances = $user->getBalances();
// Get user total balance.
$balance = $user->getTotalBalance();
Array
(
[amount] => 3.14
[currency] => BTC
)
use Uphold\UpholdClient as Client;
// Initialize the client.
$client = new Client();
// Get user.
$user = $client->getUser('AUTHORIZATION_TOKEN');
// Get current user cards.
$cards = $user->getCards();
use Uphold\UpholdClient as Client;
// Initialize the client.
$client = new Client();
// Get the current user.
$user = $client->getUser('AUTHORIZATION_TOKEN');
// Create a new 'BTC' card.
$card = $user->createCard('My new card', 'BTC');
use Uphold\UpholdClient as Client;
// Initialize the client.
$client = new Client();
// Get user.
$user = $client->getUser('AUTHORIZATION_TOKEN');
// Get a specific card by id.
$card = $user->getCardById('ade869d8-7913-4f67-bb4d-72719f0a2be0');
// Create a new transaction.
$transaction = $card->createTransaction('[email protected]', '2.0', 'BTC');
// Commit the transaction.
$transaction->commit();
use \Uphold\UpholdClient as Client;
// Initialize the client.
$client = new Client();
// Get all public transactions (public endpoint).
$pager = $client->getReserve()->getTransactions();
// Get next page of transactions.
$transactions = $pager->getNext();
// Get one public transaction.
$transaction = $client->getReserve()->getTransactionById('a97bb994-6e24-4a89-b653-e0a6d0bcf634');
use \Uphold\UpholdClient as Client;
// Initialize the client.
$client = new Client();
// Get the reserve summary of all the obligations and assets within it (public endpoint).
$statistics = $client->getReserve()->getStatistics();
// Get public transactions.
$pager = $client->getReserve()->getTransactions();
// Check whether the paginator has a valid next page.
while($pager->hasNext()) {
// Get next page with results.
$transactions = $pager->getNext();
// Do something...
}
json
{
"eegno/uphold-sdk-php": "~5.0"
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.