public function test_PFIF_instruction_txn()
 {
     $request = new LitleRequest($this->config);
     // first batch
     $batch_request = new BatchRequest($this->direct);
     $submerchantCreditHash = array('id' => '1211', 'fundingSubmerchantId' => '2111', 'submerchantName' => '001', 'fundsTransferId' => '12345678', 'amount' => '13', 'accountInfo' => array('accType' => 'Checking', 'accNum' => '1092969901', 'routingNum' => '011075150', 'checkNum' => '123455'));
     $batch_request->addSubmerchantCredit($submerchantCreditHash);
     $payFacCreditHash = array('id' => '1211', 'fundingSubmerchantId' => '2111', 'fundsTransferId' => '12345678', 'amount' => '13');
     $batch_request->addPayFacCredit($payFacCreditHash);
     $vendorCreditHash = array('id' => '1211', 'fundingSubmerchantId' => '2111', 'vendorName' => '001', 'fundsTransferId' => '12345678', 'amount' => '13', 'accountInfo' => array('accType' => 'Checking', 'accNum' => '1092969901', 'routingNum' => '011075150', 'checkNum' => '123455'));
     $batch_request->addVendorCredit($vendorCreditHash);
     $reserveCreditHash = array('id' => '1211', 'fundingSubmerchantId' => '2111', 'fundsTransferId' => '12345678', 'amount' => '13');
     $batch_request->addReserveCredit($reserveCreditHash);
     $physicalCheckCreditHash = array('id' => '1211', 'fundingSubmerchantId' => '2111', 'fundsTransferId' => '12345678', 'amount' => '13');
     $batch_request->addPhysicalCheckCredit($physicalCheckCreditHash);
     $submerchantDebitHash = array('id' => '1211', 'fundingSubmerchantId' => '2111', 'submerchantName' => '001', 'fundsTransferId' => '12345678', 'amount' => '13', 'accountInfo' => array('accType' => 'Checking', 'accNum' => '1092969901', 'routingNum' => '011075150', 'checkNum' => '123455'));
     $batch_request->addSubmerchantDebit($submerchantDebitHash);
     $payFacDebitHash = array('id' => '1211', 'fundingSubmerchantId' => '2111', 'fundsTransferId' => '12345678', 'amount' => '13');
     $batch_request->addPayFacDebit($payFacDebitHash);
     $vendorDebitHash = array('id' => '1211', 'fundingSubmerchantId' => '2111', 'vendorName' => '001', 'fundsTransferId' => '12345678', 'amount' => '13', 'accountInfo' => array('accType' => 'Checking', 'accNum' => '1092969901', 'routingNum' => '011075150', 'checkNum' => '123455'));
     $batch_request->addVendorDebit($vendorDebitHash);
     $reserveDebitHash = array('id' => '1211', 'fundingSubmerchantId' => '2111', 'fundsTransferId' => '12345678', 'amount' => '13');
     $batch_request->addReserveDebit($reserveDebitHash);
     $physicalCheckDebitHash = array('id' => '1211', 'fundingSubmerchantId' => '2111', 'fundsTransferId' => '12345678', 'amount' => '13');
     $batch_request->addPhysicalCheckDebit($physicalCheckDebitHash);
     $request->addBatchRequest($batch_request);
     $response = $request->sendToLitleStream();
     $respProcessor = new LitleResponseProcessor($response);
     $txnResponse = $respProcessor->nextTransaction();
     $txnCount = 0;
     while ($txnResponse != FALSE) {
         $this->assertEquals($txnResponse->response, '000');
         $txnCount++;
         $txnResponse = $respProcessor->nextTransaction();
     }
     $this->assertEquals($txnCount, 10);
 }
 public function test_addSubmerchantCredit()
 {
     $hash_in = array('fundingSubmerchantId' => '2111', 'submerchantName' => '001', 'fundsTransferId' => '12345678', 'amount' => '13', 'accountInfo' => array('accType' => 'Checking', 'accNum' => '12345657890', 'routingNum' => '123456789', 'checkNum' => '123455'));
     $batch_request = new BatchRequest($this->direct);
     $batch_request->addSubmerchantCredit($hash_in);
     $this->assertTrue(file_exists($batch_request->batch_file));
     $this->assertEquals(1, $batch_request->total_txns);
     $cts = $batch_request->getCountsAndAmounts();
     $this->assertEquals(1, $cts['submerchantCredit']['count']);
     $this->assertEquals(13, $cts['submerchantCredit']['amount']);
 }