Skip to content

Commit

Permalink
Added get parameter to ZoopChargesCNP::getAll function
Browse files Browse the repository at this point in the history
  • Loading branch information
adhenrique committed May 4, 2017
1 parent 4bfcf23 commit d4f5ff2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Contracts/ZoopChargesCNP.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public function get($transactionID);

/**
* Returns a JSON object with a list of transactions.
* @param $get array || null
*/
public function getAll();
public function getAll($get = null);
}
9 changes: 7 additions & 2 deletions src/Lib/ZoopChargesCNP.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,15 @@ public function get($transactionID){
}

/**
* @param $get array || null
* @return mixed
*/
public function getAll(){
$api = 'transactions';
public function getAll($get = null){
if(!is_null($get)){
$api = 'transactions?' . http_build_query($get);
}else{
$api = 'transactions';
}
return $this->APIResource->searchAPI($api);
}
}

0 comments on commit d4f5ff2

Please sign in to comment.