public function testGetTransactionList()
 {
     $request = new Request();
     $response = $request->getSettledBatchList();
     $this->assertTrue($response->isOk());
     $batches = $response->xpath("batchList/batch");
     $batch_id = (string) $batches[0]->batchId;
     $response = $request->getTransactionList($batch_id);
     $this->assertTrue($response->isOk());
 }
 /**
  * Return all transactions for a certain day.
  *
  * @param int $month
  * @param int $day
  * @param int $year
  *
  * @return array Array of SimpleXMLElments
  */
 public function getTransactionsForDay($month = false, $day = false, $year = false)
 {
     $transactions = array();
     $month = $month ? $month : date('m');
     $day = $day ? $day : date('d');
     $year = $year ? $year : date('Y');
     $firstSettlementDate = substr(date('c', mktime(0, 0, 0, (int) $month, (int) $day, (int) $year)), 0, -6);
     $lastSettlementDate = substr(date('c', mktime(0, 0, 0, (int) $month, (int) $day, (int) $year)), 0, -6);
     $response = $this->getSettledBatchList(true, $firstSettlementDate, $lastSettlementDate);
     $batches = $response->xpath("batchList/batch");
     foreach ($batches as $batch) {
         $batch_id = (string) $batch->batchId;
         $request = new Request();
         $tran_list = $request->getTransactionList($batch_id);
         $transactions = array_merge($transactions, $tran_list->xpath("transactions/transaction"));
     }
     return $transactions;
 }