public function testGetBatchStatistics() { $request = new Request(); $response = $request->getSettledBatchList(); $this->assertTrue($response->isOk()); $this->assertTrue($response->xml->batchList->count() >= 1); $batchId = $response->xml->batchList->batch[0]->batchId; $request = new Request(); $response = $request->getBatchStatistics($batchId); $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; }