public function test_echeckCredit()
 {
     $hash_in = array('id' => '1211', 'litleTxnId' => '123456789012345678', 'amount' => '1000');
     $litle = new LitleOnlineRequest($treeResponse = true);
     $response = $litle->echeckCreditRequest($hash_in);
     $this->assertEquals('001', $response->echeckCreditResponse->response);
 }
 public function test_echeckCredit_missing_billing()
 {
     $hash_in = array('amount' => '123456', 'verify' => 'true', 'orderId' => '12345', 'orderSource' => 'ecommerce', 'echeckToken' => array('accType' => 'Checking', 'litleToken' => '1234565789012', 'routingNum' => '123456789', 'checkNum' => '123455'));
     $initilaize = new LitleOnlineRequest();
     $echeckCreditResponse = $initilaize->echeckCreditRequest($hash_in);
     $message = XmlParser::getAttribute($echeckCreditResponse, 'litleOnlineResponse', 'message');
     $this->assertRegExp('/Error validating xml data against the schema/', $message);
 }
 public function test_simple_echeckCredit_With_SecondaryAmount()
 {
     $hash_in = array('id' => 'id', 'litleTxnId' => '123456789012345678', 'secondaryAmount' => '100', 'amount' => '1000');
     $initilaize = new LitleOnlineRequest();
     $echeckCreditResponse = $initilaize->echeckCreditRequest($hash_in);
     $response = XmlParser::getNode($echeckCreditResponse, 'response');
     $this->assertEquals('001', $response);
 }
 public function test_echeck_credit_secondaryAmount()
 {
     $hash_in = array('amount' => '5000', 'id' => 'id', 'secondaryAmount' => '2000', 'orderSource' => 'ecommerce', 'billToAddress' => array(), 'echeck' => array('accType' => 'Checking', 'routingNum' => '123123', 'accNum' => '12345657890', 'checkNum' => '123455'));
     $mock = $this->getMock('litle\\sdk\\LitleXmlMapper');
     $mock->expects($this->once())->method('request')->with($this->matchesRegularExpression('/.*<amount>5000.*<orderSource>ecommerce.*<accType>Checking.*<accNum>12345657890.*<routingNum>123123.*<checkNum>123455.*/'));
     $litleTest = new LitleOnlineRequest();
     $litleTest->newXML = $mock;
     $litleTest->echeckCreditRequest($hash_in);
 }
 public function test_loggedInUser()
 {
     $hash_in = array('litleTxnId' => '123123', 'merchantSdk' => 'PHP;8.14.0', 'loggedInUser' => 'gdake');
     $mock = $this->getMock('litle\\sdk\\LitleXmlMapper');
     $mock->expects($this->once())->method('request')->with($this->matchesRegularExpression('/.*merchantSdk="PHP;8.14.0".*loggedInUser="******" xmlns=.*>.*/'));
     $litleTest = new LitleOnlineRequest();
     $litleTest->newXML = $mock;
     $litleTest->echeckCreditRequest($hash_in);
 }
 /**
  * Make an echeckCredit API request.
  *
  * This method wraps the LitleOnlineRequest.
  *
  * @param array $hash_in
  *   The request data.
  *
  * @return DOMDocument|SimpleXMLElement
  *   The response.
  */
 public function echeckCreditRequest($hash_in)
 {
     return $this->request->echeckCreditRequest($hash_in);
 }
 public function test_49()
 {
     $echeck_hash = array('litleTxnId' => '2', 'id' => 'id');
     $initilaize = new LitleOnlineRequest();
     $echeckCreditResponse = $initilaize->echeckCreditRequest($echeck_hash);
     $this->assertEquals('001', XMLParser::getNode($echeckCreditResponse, 'response'));
     $this->assertEquals('Transaction Received', XMLParser::getNode($echeckCreditResponse, 'message'));
 }
 public function test_49()
 {
     $echeck_hash = array('litleTxnId' => '2');
     $initilaize = new LitleOnlineRequest();
     $echeckCreditResponse = $initilaize->echeckCreditRequest($echeck_hash);
     $this->assertEquals('360', XMLParser::getNode($echeckCreditResponse, 'response'));
     $this->assertEquals('No transaction found with specified litleTxnId', XMLParser::getNode($echeckCreditResponse, 'message'));
 }