Skip to content

Commit ed1d773

Browse files
committed
v1.6.2
* Minor fixes
1 parent b4fef92 commit ed1d773

File tree

3 files changed

+102
-34
lines changed

3 files changed

+102
-34
lines changed

CryptAPI/CryptAPI.php

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@ class CryptAPI
1717
private $parameters = [];
1818
private $api_key = null;
1919

20-
public static $COIN_MULTIPLIERS = [
21-
'btc' => 10 ** 8,
22-
'bch' => 10 ** 8,
23-
'ltc' => 10 ** 8,
24-
'eth' => 10 ** 18,
25-
'iota' => 10 ** 6,
26-
'xmr' => 10 ** 12,
27-
'trx' => 10 ** 6,
28-
];
29-
3020
public function __construct($coin, $own_address, $callback_url, $parameters = [], $ca_params = [], $api_key = null)
3121
{
3222
$this->valid_coins = CryptAPI::get_supported_coins();
@@ -102,7 +92,6 @@ public function get_address()
10292
$response = CryptAPI::_request($this->coin, 'create', $ca_params);
10393

10494
if ($response->status == 'success') {
105-
// assert($response->address_out == $this->own_address, 'Output address mismatch');
10695
$this->payment_address = $response->address_in;
10796
return $response->address_in;
10897
}
@@ -141,8 +130,14 @@ public function get_qrcode($value = false, $size = false)
141130
return null;
142131
}
143132

133+
$address = $this->payment_address;
134+
135+
if (empty($address)) {
136+
$address = $this->get_address();
137+
}
138+
144139
$params = [
145-
'address' => $this->payment_address,
140+
'address' => $address,
146141
];
147142

148143
if ($value) {

0 commit comments

Comments
 (0)