@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | $rate = array_reduce( |
123 | 123 | $rates, |
124 | - function ($carry, $item) use ($isoTo) { |
|
124 | + function($carry, $item) use ($isoTo) { |
|
125 | 125 | if ($item->to->iso === $isoTo) { |
126 | 126 | $carry = $this->amountFactory->create($item->rate, null, $item->pow); |
127 | 127 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | * @return mixed Bills list |
207 | 207 | * @throws B2BinpayException |
208 | 208 | */ |
209 | - public function getBills(array $params = []) |
|
209 | + public function getBills(array $params = [ ]) |
|
210 | 210 | { |
211 | 211 | $url = $this->api->getBillsUrl(null, $params); |
212 | 212 | |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | * @return mixed Transactions list |
233 | 233 | * @throws B2BinpayException |
234 | 234 | */ |
235 | - public function getTransactions(array $params = []) |
|
235 | + public function getTransactions(array $params = [ ]) |
|
236 | 236 | { |
237 | 237 | $url = $this->api->getTransactionsUrl(null, $params); |
238 | 238 | |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | * @return mixed VirtualWallets list |
259 | 259 | * @throws B2BinpayException |
260 | 260 | */ |
261 | - public function getVirtualWallets(array $params = []) |
|
261 | + public function getVirtualWallets(array $params = [ ]) |
|
262 | 262 | { |
263 | 263 | $url = $this->api->getVirtualWalletsUrl(null, $params); |
264 | 264 | |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | * @return mixed Withdrawals list |
334 | 334 | * @throws B2BinpayException |
335 | 335 | */ |
336 | - public function getWithdrawals(array $params = []) |
|
336 | + public function getWithdrawals(array $params = [ ]) |
|
337 | 337 | { |
338 | 338 | $url = $this->api->getWithdrawalsUrl(null, $params); |
339 | 339 | |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | * @return mixed Transfers list |
360 | 360 | * @throws B2BinpayException |
361 | 361 | */ |
362 | - public function getTransfers(array $params = []) |
|
362 | + public function getTransfers(array $params = [ ]) |
|
363 | 363 | { |
364 | 364 | $url = $this->api->getTransfersUrl(null, $params); |
365 | 365 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | * @param array $params |
17 | 17 | * @return mixed |
18 | 18 | */ |
19 | - public function sendRequest(string $method, string $url, array $params = []); |
|
19 | + public function sendRequest(string $method, string $url, array $params = [ ]); |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * @return string |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | */ |
18 | 18 | class Request |
19 | 19 | { |
20 | - const ERROR_UPDATE_TOKEN = ['-240', 'RESULT_TOKEN_ERROR_EXPIRED']; |
|
20 | + const ERROR_UPDATE_TOKEN = [ '-240', 'RESULT_TOKEN_ERROR_EXPIRED' ]; |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * @var Client |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * @param array|null $params |
37 | 37 | * @return mixed |
38 | 38 | */ |
39 | - public function send(string $token, string $method, string $url, array $params = []) |
|
39 | + public function send(string $token, string $method, string $url, array $params = [ ]) |
|
40 | 40 | { |
41 | 41 | $header = [ |
42 | 42 | 'Authorization' => 'Bearer ' . $token |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | } |
103 | 103 | |
104 | 104 | if (!empty($responseDecode->error)) { |
105 | - if ([$responseDecode->code, $responseDecode->error] == self::ERROR_UPDATE_TOKEN) { |
|
105 | + if ([ $responseDecode->code, $responseDecode->error ] == self::ERROR_UPDATE_TOKEN) { |
|
106 | 106 | throw new UpdateTokenException(); |
107 | 107 | } |
108 | 108 |
@@ -275,8 +275,8 @@ |
||
275 | 275 | $iso = array_reduce( |
276 | 276 | self::$list, |
277 | 277 | function ($carry, $item) use ($alpha) { |
278 | - $nodeList = isset($item['node']) ? $item['node'] : []; |
|
279 | - $nodeList = array_map('strtoupper', $nodeList); |
|
278 | + $nodeList = isset($item['node']) ? $item['node'] : []; |
|
279 | + $nodeList = array_map('strtoupper', $nodeList); |
|
280 | 280 | |
281 | 281 | if ($item['alpha'] === $alpha || in_array($alpha, $nodeList)) { |
282 | 282 | $carry = $item['iso']; |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | if (!array_key_exists($iso, Currency::$list)) { |
261 | 261 | throw new UnknownValueException($iso); |
262 | 262 | } |
263 | - return Currency::$list[$iso]['alpha']; |
|
263 | + return Currency::$list[ $iso ][ 'alpha' ]; |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | /** |
@@ -274,12 +274,12 @@ discard block |
||
274 | 274 | |
275 | 275 | $iso = array_reduce( |
276 | 276 | self::$list, |
277 | - function ($carry, $item) use ($alpha) { |
|
278 | - $nodeList = isset($item['node']) ? $item['node'] : []; |
|
277 | + function($carry, $item) use ($alpha) { |
|
278 | + $nodeList = isset($item[ 'node' ]) ? $item[ 'node' ] : [ ]; |
|
279 | 279 | $nodeList = array_map('strtoupper', $nodeList); |
280 | 280 | |
281 | - if ($item['alpha'] === $alpha || in_array($alpha, $nodeList)) { |
|
282 | - $carry = $item['iso']; |
|
281 | + if ($item[ 'alpha' ] === $alpha || in_array($alpha, $nodeList)) { |
|
282 | + $carry = $item[ 'iso' ]; |
|
283 | 283 | } |
284 | 284 | return (int)$carry; |
285 | 285 | } |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | throw new UnknownValueException($iso); |
304 | 304 | } |
305 | 305 | |
306 | - return self::$list[$iso]['precision']; |
|
306 | + return self::$list[ $iso ][ 'precision' ]; |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | /** |
@@ -325,6 +325,6 @@ discard block |
||
325 | 325 | throw new UnknownValueException($iso); |
326 | 326 | } |
327 | 327 | |
328 | - return self::$list[$iso]['name']; |
|
328 | + return self::$list[ $iso ][ 'name' ]; |
|
329 | 329 | } |
330 | 330 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * @param array $params |
108 | 108 | * @return mixed |
109 | 109 | */ |
110 | - public function sendRequest(string $method, string $url, array $params = []) |
|
110 | + public function sendRequest(string $method, string $url, array $params = [ ]) |
|
111 | 111 | { |
112 | 112 | $token = $this->getAccessToken(); |
113 | 113 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | throw new UnknownValueException($currency); |
142 | 142 | } |
143 | 143 | |
144 | - return self::$node[$currency]; |
|
144 | + return self::$node[ $currency ]; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | |
37 | 37 | // Convert currency |
38 | 38 | $amount = $provider->convertCurrency( |
39 | - $withdrawal_request['amount'], |
|
39 | + $withdrawal_request[ 'amount' ], |
|
40 | 40 | $virtual_wallet_currency, |
41 | - $withdrawal_request['currency'], |
|
41 | + $withdrawal_request[ 'currency' ], |
|
42 | 42 | $rates |
43 | 43 | ); |
44 | 44 | |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | $withdrawal = $provider->createWithdrawal( |
47 | 47 | $virtual_wallet_id, |
48 | 48 | $amount, |
49 | - $withdrawal_request['currency'], |
|
50 | - $withdrawal_request['address'], |
|
51 | - $withdrawal_request['unique_id'], |
|
52 | - $withdrawal_request['track_id'], |
|
53 | - $withdrawal_request['callback_url'] |
|
49 | + $withdrawal_request[ 'currency' ], |
|
50 | + $withdrawal_request[ 'address' ], |
|
51 | + $withdrawal_request[ 'unique_id' ], |
|
52 | + $withdrawal_request[ 'track_id' ], |
|
53 | + $withdrawal_request[ 'callback_url' ] |
|
54 | 54 | ); |
55 | 55 | |
56 | 56 | echo '<pre>'; |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | |
4 | 4 | // Select wallet and set currency |
5 | 5 | $currency = 'BTC'; |
6 | -$wallet_id = getWallets()[$currency]; |
|
6 | +$wallet_id = getWallets()[ $currency ]; |
|
7 | 7 | |
8 | 8 | if (empty($wallet_id)) { |
9 | 9 | echo '<pre>Please, set wallet id for BTC variable in .env</pre>'; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | // Convert currency |
36 | 36 | $clean_amount = $provider->convertCurrency( |
37 | - $bill_request['amount'], |
|
37 | + $bill_request[ 'amount' ], |
|
38 | 38 | getBaseCurrency(), |
39 | 39 | $currency, |
40 | 40 | $rates |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | $wallet_id, |
49 | 49 | $amount, |
50 | 50 | $currency, |
51 | - $bill_request['lifetime'], |
|
52 | - $bill_request['track_id'], |
|
53 | - $bill_request['callback_url'], |
|
51 | + $bill_request[ 'lifetime' ], |
|
52 | + $bill_request[ 'track_id' ], |
|
53 | + $bill_request[ 'callback_url' ], |
|
54 | 54 | null, |
55 | 55 | null |
56 | 56 | ); |
@@ -7,7 +7,7 @@ |
||
7 | 7 | $bills_param = [ |
8 | 8 | 'query' => [ |
9 | 9 | 'filter' => [ |
10 | - 'wallet_id' => getWallets()['BTC'], // (int) Select bills only created for wallet 442 |
|
10 | + 'wallet_id' => getWallets()[ 'BTC' ], // (int) Select bills only created for wallet 442 |
|
11 | 11 | // 'address' => '5f7af8aed5fa7a9df2255ad642b923d95503b9a7958d8' // (string) Blockchain address or destination tag (memo, message) bill |
12 | 12 | // 'currency' => $currency->getIso('BTC'), // (int) ISO currency code |
13 | 13 | 'status' => 2, // (int) See in list of bills statuses |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | // Select erc20 wallet |
5 | 5 | $eth_currency = 'ETH'; |
6 | 6 | $erc20_currency = 'USDT-ETH'; |
7 | -$wallet_eth_id = getWallets()[$eth_currency]; |
|
8 | -$wallet_erc20_id = getWallets()[$erc20_currency]; |
|
7 | +$wallet_eth_id = getWallets()[ $eth_currency ]; |
|
8 | +$wallet_erc20_id = getWallets()[ $erc20_currency ]; |
|
9 | 9 | |
10 | 10 | if (empty($wallet_eth_id) || empty($wallet_erc20_id)) { |
11 | 11 | echo '<pre>Please, set wallet id for ETH and USDT-ETH variables in .env</pre>'; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | // Convert currency |
38 | 38 | $clean_amount = $provider->convertCurrency( |
39 | - $bill_request['amount'], |
|
39 | + $bill_request[ 'amount' ], |
|
40 | 40 | getBaseCurrency(), |
41 | 41 | $erc20_currency, |
42 | 42 | $rates |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | $wallet_eth_id, |
51 | 51 | '1', |
52 | 52 | $eth_currency, |
53 | - $bill_request['lifetime'], |
|
54 | - $bill_request['track_id'], |
|
55 | - $bill_request['callback_url'], |
|
53 | + $bill_request[ 'lifetime' ], |
|
54 | + $bill_request[ 'track_id' ], |
|
55 | + $bill_request[ 'callback_url' ], |
|
56 | 56 | null, |
57 | 57 | null |
58 | 58 | ); |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | $wallet_erc20_id, |
63 | 63 | $amount, |
64 | 64 | $erc20_currency, |
65 | - $bill_request['lifetime'], |
|
66 | - $bill_request['track_id'], |
|
67 | - $bill_request['callback_url'], |
|
65 | + $bill_request[ 'lifetime' ], |
|
66 | + $bill_request[ 'track_id' ], |
|
67 | + $bill_request[ 'callback_url' ], |
|
68 | 68 | null, |
69 | 69 | null, |
70 | 70 | $bill_eth->address // The address of the parent bill must be specified here |