-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.php
97 lines (76 loc) · 1.91 KB
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
require_once 'HolyTransaction/HolyTransaction.php';
$apiUserId = 0;
$apiUserKey = '';
//$username = '';
//$password = '';
//$apiUserKey = \HolyTransaction\HolyTransaction::getUserApiKey($username, $password);
$ht = new \HolyTransaction\HolyTransaction($apiUserId, $apiUserKey);
/**
* Exchange rates
*/
echo '<h1>Exchange rates</h1>';
$exchangeRates = $ht->get('data/exchange_rates', array('show_fiat' => 1), false);
var_dump($exchangeRates);
/**
* Balances
*/
//echo '<h1>Balances</h1>';
//$balances = $ht->get('balances');
//var_dump($balances);
/**
* Exchange orders with pagination
*/
//echo '<h1>Exchange orders</h1>';
//$orders = $ht->get('exchange_orders', array(
// 'per_page' => 3,
// 'page' => 2,
//));
//var_dump($orders);
//
//echo '<h3>Pagination</h3>';
//var_dump($ht->getPagination());
/**
* Check email
*/
//echo '<h1>Check email</h1>';
//$email_used = $ht->post('accounts/is_email_used', array('email' => '[email protected]'));
//var_dump($email_used);
/**
* Create HolyTransaction user
*/
/*
echo '<h1>Registration</h1>';
// Turn debugging on
$ht->getClient()->setDebug();
$username = '-----USERNAME-----';
$password = '-----PASSWORD-----';
$email = '[email protected]';
try {
$result = $ht->createUser($username, $password, $email);
}
catch (\HolyTransaction\APIException $e) {
echo '<h3>Exception</h3>';
var_dump($e);
}
echo '<h3>Result</h3>';
var_dump($result);
echo '<h3>Debug</h3>';
var_dump($ht->getClient()->getDebugLog());
*/
/**
* Create Wallet (and HolyTransaction) User
*/
//$username = '-----USERNAME-----';
//$password = '-----PASSWORD-----';
//$email = '------E-MAIL------';
//$wallet_token = '-----WALLET_TOKEN-----';
//
//try{
// $result = $ht->createWalletUser($username, $password, $email, $wallet_token);
// var_dump($result);
//}
//catch (\HolyTransaction\APIException $e) {
// echo '<h3>Error</h3>';
// var_dump($e);
//}