Skip to content

Commit

Permalink
disambiguation for withdraw and sweep
Browse files Browse the repository at this point in the history
  • Loading branch information
Atif Nazir committed Sep 13, 2020
1 parent 2430f6e commit 94e3dd7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Block.io PHP
===========

**Current Release**: 1.3.4
**Current Release**: 1.3.5

**09/12/20**: Change _withdraw and _sweep names for further disambiguation from actual API endpoints.
**08/15/20**: Add cURL headers for requests.
**07/03/20**: Use implode() instead of join() to remove PHP7.4 warning.
**07/01/20**: Use low R signatures by default.
Expand Down
1 change: 1 addition & 0 deletions examples/basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
echo "Status: ".$withdrawInfo->status."\n";

echo "Executed Transaction ID: ".$withdrawInfo->data->txid."\n";
echo "Block.io Fee Charged: ".$withdrawInfo->data->blockio_fee." ".$withdrawInfo->data->network."\n";
echo "Network Fee Charged: ".$withdrawInfo->data->network_fee." ".$withdrawInfo->data->network."\n";
} catch (Exception $e) {
echo $e->getMessage() . "\n";
Expand Down
8 changes: 4 additions & 4 deletions lib/block_io.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ public function __call($name, array $args)

if ( in_array($name, $this->withdrawal_methods) )
{ // it is a withdrawal method, let's do the client side signing bit
$response = $this->_withdraw($name, $args);
$response = $this->_internal_withdraw($name, $args);
}
elseif (in_array($name, $this->sweep_methods))
{ // it is a sweep method
$response = $this->_sweep($name, $args);
$response = $this->_internal_sweep($name, $args);
}
else
{ // it is not a withdrawal method, let it go to Block.io
Expand Down Expand Up @@ -127,7 +127,7 @@ private function _request($path, $args = array(), $method = 'POST')
}


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

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

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

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

0 comments on commit 94e3dd7

Please sign in to comment.