diff --git a/examples/.env.example b/examples/.env.example index c6e9c65..5011494 100644 --- a/examples/.env.example +++ b/examples/.env.example @@ -1,4 +1,3 @@ - COBRAND_NAME='' COBRAND_LOGIN='' COBRAND_PASSWORD='' diff --git a/examples/index.php b/examples/index.php index bd7fa3b..038b855 100644 --- a/examples/index.php +++ b/examples/index.php @@ -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
';
 print_r($transactions);
diff --git a/src/Api/Endpoints/Transactions.php b/src/Api/Endpoints/Transactions.php
index e570747..9574dc5 100644
--- a/src/Api/Endpoints/Transactions.php
+++ b/src/Api/Endpoints/Transactions.php
@@ -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 = [])
     {
@@ -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;
     }
 }