private function buildTransferReversal($xml)
 {
     $transferReversal = new TransferReversal();
     $transferReversal->setRequestId((string) $xml->RequestId);
     $transferReversal->setOriginalRequestId((string) $xml->OriginalRequestId);
     $transferReversal->setTransactionReference((string) $xml->TransactionReference);
     $transactionHistory = new TransactionHistory();
     $tmpTransaction = new Transaction();
     $transaction = $xml->TransactionHistory->Transaction;
     $tmpTransaction->setType((string) $transaction->Type);
     $tmpTransaction->setSystemTraceAuditNumber((string) $transaction->SystemTraceAuditNumber);
     $tmpTransaction->setNetworkReferenceNumber((string) $transaction->NetworkReferenceNumber);
     $tmpTransaction->setSettlementDate((string) $transaction->SettlementDate);
     $tmpResponse = new Response();
     $response = $transaction->Response;
     $tmpResponse->setCode((string) $response->Code);
     $tmpResponse->setDescription((string) $response->Description);
     $tmpTransaction->setSubmitDateTime((string) $transaction->SubmitDateTime);
     $tmpTransaction->setResponse($tmpResponse);
     $transactionHistory->setTransaction($tmpTransaction);
     $transferReversal->setTransactionHistory($transactionHistory);
     return $transferReversal;
 }
 private function buildTransfer($xml)
 {
     $transfer = new Transfer();
     $transfer->setRequestId((string) $xml->RequestId);
     $transfer->setTransactionReference((string) $xml->TransactionReference);
     $transactionHistory = new TransactionHistory();
     $transactionArray = array();
     foreach ($xml->TransactionHistory->Transaction as $transaction) {
         $tmpTransaction = new Transaction();
         $tmpTransaction->setType((string) $transaction->Type);
         $tmpTransaction->setSystemTraceAuditNumber((string) $transaction->SystemTraceAuditNumber);
         $tmpTransaction->setNetworkReferenceNumber((string) $transaction->NetworkReferenceNumber);
         $tmpTransaction->setSettlementDate((string) $transaction->SettlementDate);
         $tmpResponse = new Response();
         $response = $transaction->Response;
         $tmpResponse->setCode((string) $response->Code);
         $tmpResponse->setDescription((string) $response->Description);
         $tmpTransaction->setSubmitDateTime((string) $transaction->SubmitDateTime);
         $tmpTransaction->setResponse($tmpResponse);
         array_push($transactionArray, $tmpTransaction);
     }
     $transactionHistory->setTransaction($transactionArray);
     $transfer->setTransactionHistory($transactionHistory);
     return $transfer;
 }