public function test_simple()
 {
     $hash_in = array('orderId' => '1', 'amount' => '2', 'orderSource' => 'ecommerce', 'card' => array('type' => 'VI', 'number' => '4100000000000000', 'expDate' => '1213', 'cardValidationNum' => '1213'));
     $initialize = new LitleOnlineRequest();
     $response = $initialize->load($hash_in);
     $message = XmlParser::getAttribute($response, 'litleOnlineResponse', 'message');
     $this->assertEquals('Valid Format', $message);
 }
Ejemplo n.º 2
0
 public function test_simple()
 {
     $hash_in = array('orderId' => '1', 'amount' => '2', 'id' => 'id', 'orderSource' => 'ECOMMERCE', 'card' => array('type' => 'VI', 'number' => '4100000000000000', 'expDate' => '1213', 'cardValidationNum' => '1213'));
     $mock = $this->getMock('litle\\sdk\\LitleXmlMapper');
     $mock->expects($this->once())->method('request')->with($this->matchesRegularExpression('/.*<orderId>1.*<amount>2.*<orderSource>ECOMMERCE.*<card.*type.*VI.*/'));
     $litleTest = new LitleOnlineRequest();
     $litleTest->newXML = $mock;
     $litleTest->load($hash_in);
 }
Ejemplo n.º 3
0
 /**
  * Make a load API request.
  *
  * This method wraps the LitleOnlineRequest.
  *
  * @param array $hash_in
  *   The request data.
  *
  * @return DOMDocument|SimpleXMLElement
  *   The response.
  */
 public function load($hash_in)
 {
     return $this->request->load($hash_in);
 }