Skip to content

Commit

Permalink
Transactions now returns an array.
Browse files Browse the repository at this point in the history
  • Loading branch information
kmanuzon committed May 10, 2016
1 parent 82a4977 commit bd3cb53
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion examples/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

COBRAND_NAME=''
COBRAND_LOGIN=''
COBRAND_PASSWORD=''
Expand Down
4 changes: 2 additions & 2 deletions examples/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

// user transactions.
$transactions = $yodleeApi->transactions()->getTransactions([
'fromDate' => '2014-01-01',
'toDate' => '2014-12-31'
'fromDate' => '2012-01-01',
'toDate' => '2015-12-31'
]);
print '$transactions<pre>';
print_r($transactions);
Expand Down
8 changes: 4 additions & 4 deletions src/Api/Endpoints/Transactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(Factory $factory, SessionToken $sessionToken)
* Get all the transactions of the user in session.
*
* @param array
* @return \stdClass|bool
* @return array
*/
public function getTransactions(array $parameters = [])
{
Expand All @@ -39,11 +39,11 @@ public function getTransactions(array $parameters = [])

$result = Curl::dispatch('GET', $url, $parameters, $headers);

if (isset($result['error'])) {
if (isset($result['error']) || empty($result['body']->transaction)) {

return false;
return [];
}

return $result['body'];
return $result['body']->transaction;
}
}

0 comments on commit bd3cb53

Please sign in to comment.