Example #1
0
 /**
  * Test getBatchProcessResultFile with an ACH / EFT batch process after
  * sending an incorrectly encoded request.
  *
  * @depends testProcessLinkprocessACHEFTChargeBatchInvalidRequest
  */
 public function testProcessLinkgetBatchProcessResultFileACHEFTInvalidRequest()
 {
     // Create and populate the request object.
     $request = array('customerIPAddress' => '', 'batchId' => self::$ACHEFTBatchId);
     $iats = new ProcessLink(self::$agentCode, self::$password);
     $response = $iats->getBatchProcessResultFile($request);
     $this->assertEquals('Batch Process Has Been Done', trim($response['AUTHORIZATIONRESULT']));
     $this->assertEquals(self::$ACHEFTBatchId, $response['BATCHID']);
     $batchResultFileContents = trim(base64_decode($response['BATCHPROCESSRESULTFILE']));
     $batchData = explode("\r\n", $batchResultFileContents);
     foreach ($batchData as $batchRow) {
         $batchRowData = str_getcsv($batchRow);
         // Get result message from end of array.
         $batchRowMessage = array_pop($batchRowData);
         $this->assertStringStartsWith('Wrong Format', $batchRowMessage);
     }
 }