Skip to content

Commit 94e3dd7

Browse files
author
Atif Nazir
committed
disambiguation for withdraw and sweep
1 parent 2430f6e commit 94e3dd7

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
Block.io PHP
22
===========
33

4-
**Current Release**: 1.3.4
4+
**Current Release**: 1.3.5
55

6+
**09/12/20**: Change _withdraw and _sweep names for further disambiguation from actual API endpoints.
67
**08/15/20**: Add cURL headers for requests.
78
**07/03/20**: Use implode() instead of join() to remove PHP7.4 warning.
89
**07/01/20**: Use low R signatures by default.

examples/basic.php

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
echo "Status: ".$withdrawInfo->status."\n";
8383

8484
echo "Executed Transaction ID: ".$withdrawInfo->data->txid."\n";
85+
echo "Block.io Fee Charged: ".$withdrawInfo->data->blockio_fee." ".$withdrawInfo->data->network."\n";
8586
echo "Network Fee Charged: ".$withdrawInfo->data->network_fee." ".$withdrawInfo->data->network."\n";
8687
} catch (Exception $e) {
8788
echo $e->getMessage() . "\n";

lib/block_io.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ public function __call($name, array $args)
4949

5050
if ( in_array($name, $this->withdrawal_methods) )
5151
{ // it is a withdrawal method, let's do the client side signing bit
52-
$response = $this->_withdraw($name, $args);
52+
$response = $this->_internal_withdraw($name, $args);
5353
}
5454
elseif (in_array($name, $this->sweep_methods))
5555
{ // it is a sweep method
56-
$response = $this->_sweep($name, $args);
56+
$response = $this->_internal_sweep($name, $args);
5757
}
5858
else
5959
{ // it is not a withdrawal method, let it go to Block.io
@@ -127,7 +127,7 @@ private function _request($path, $args = array(), $method = 'POST')
127127
}
128128

129129

130-
private function _withdraw($name, $args = array())
130+
private function _internal_withdraw($name, $args = array())
131131
{ // withdraw method to be called by __call
132132

133133
unset ($args['pin']); // make sure no inadvertent passing of pin occurs
@@ -184,7 +184,7 @@ private function _withdraw($name, $args = array())
184184
return $response;
185185
}
186186

187-
private function _sweep($name, $args = array())
187+
private function _internal_sweep($name, $args = array())
188188
{ // sweep method to be called by __call
189189

190190
$key = $this->initKey()->fromWif($args['private_key']);

0 commit comments

Comments
 (0)