public function test_13() { $auth_hash = array('orderId' => '13', 'amount' => '15000', 'orderSource' => 'ecommerce', 'card' => array('number' => '6011010140000004', 'expDate' => '0812', 'type' => 'DI'), 'allowPartialAuth' => 'true'); $initilaize = new LitleOnlineRequest(); $authorizationResponse = $initilaize->authorizationRequest($auth_hash); $this->assertEquals('010', XmlParser::getNode($authorizationResponse, 'response')); $this->assertEquals('Partially Approved', XmlParser::getNode($authorizationResponse, 'message')); $this->assertEquals('12000', XmlParser::getNode($authorizationResponse, 'approvedAmount')); }
public function test_pos_missing_field() { $hash_in = array('reportGroup' => 'Planets', 'orderId' => '12344', 'amount' => '106', 'orderSource' => 'ecommerce', 'pos' => array('entryMode' => '123'), 'card' => array('type' => 'VI', 'number' => '4100000000000000', 'expDate' => '1210')); $litleTest = new LitleOnlineRequest(); $this->setExpectedException('InvalidArgumentException', 'Missing Required Field: /capability/'); $retOb = $litleTest->authorizationRequest($hash_in); }
public function test_auth() { $hash_in = array('card' => array('type' => 'VI', 'number' => '4100000000000000', 'expDate' => '1213', 'cardValidationNum' => '1213'), 'id' => '1211', 'orderId' => '2111', 'reportGroup' => 'Planets', 'orderSource' => 'ecommerce', 'amount' => '123'); $litle = new LitleOnlineRequest($treeResponse = true); $response = $litle->authorizationRequest($hash_in); $this->assertEquals('000', $response->authorizationResponse->response); }
public function test_pos() { $hash_in = array('merchantId' => '101', 'version' => '8.8', 'reportGroup' => 'Planets', 'orderId' => '12344', 'amount' => '106', 'orderSource' => 'ecommerce', 'pos' => array('capability' => 'notused', 'entryMode' => 'track1', 'cardholderId' => 'pin'), 'card' => array('type' => 'VI', 'number' => '4100000000000000', 'expDate' => '1210')); $initilaize = new LitleOnlineRequest(); $authorizationResponse = $initilaize->authorizationRequest($hash_in); $message = XmlParser::getAttribute($authorizationResponse, 'litleOnlineResponse', 'message'); $this->assertEquals("Valid Format", $message); }
public function test_set_merchant_sdk_default() { $hash_in = array('orderId' => '2111', 'id' => '654', 'orderSource' => 'ecommerce', 'amount' => '123'); $mock = $this->getMock('litle\\sdk\\LitleXmlMapper'); $mock->expects($this->once())->method('request')->with($this->matchesRegularExpression('/.*merchantSdk="PHP;10.1".*/')); $litleTest = new LitleOnlineRequest(); $litleTest->newXML = $mock; $litleTest->authorizationRequest($hash_in); }
public function test_VoidSettledTransaction() { $auth_hash = array('orderId' => '1', 'amount' => '10010', 'orderSource' => 'ecommerce', 'card' => array('number' => '375001010000003', 'expDate' => '0112', 'cardValidationNum' => '1313', 'type' => 'AX')); $initilaize = new LitleOnlineRequest(); $authorizationResponse = $initilaize->authorizationRequest($auth_hash); $this->assertEquals('000', XmlParser::getNode($authorizationResponse, 'response')); $capture_hash = array('litleTxnId' => XmlParser::getNode($authorizationResponse, 'litleTxnId')); $captureResponse = $initilaize->captureRequest($capture_hash); //echo $captureResponse; $this->assertEquals('000', XmlParser::getNode($captureResponse, 'response')); $void_hash1 = array('litleTxnId' => 362); $voidResponse1 = $initilaize->voidRequest($void_hash1); $this->assertEquals('362', XmlParser::getNode($voidResponse1, 'response')); $credit_hash = array('litleTxnId' => XmlParser::getNode($captureResponse, 'litleTxnId')); $creditResponse = $initilaize->creditRequest($credit_hash); $this->assertEquals('000', XmlParser::getNode($creditResponse, 'response')); $void_hash2 = array('litleTxnId' => XmlParser::getNode($creditResponse, 'litleTxnId')); $voidResponse2 = $initilaize->voidRequest($void_hash2); $this->assertEquals('000', XmlParser::getNode($voidResponse2, 'response')); }
function test_5_avs() { $auth_hash = array('id' => '1211', 'orderId' => '5', 'amount' => '0', 'orderSource' => 'ecommerce', 'card' => array('number' => '4457010200000007', 'expDate' => '0512', 'cardValidationNum' => '463', 'type' => 'VI'), 'cardholderAuthentication' => array('authenticationValue' => 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=')); $initilaize = new LitleOnlineRequest(); $authorizationResponse = $initilaize->authorizationRequest($auth_hash); $this->assertEquals('000', XmlParser::getNode($authorizationResponse, 'response')); $this->assertEquals('Approved', XmlParser::getNode($authorizationResponse, 'message')); $this->assertEquals('55555 ', XmlParser::getNode($authorizationResponse, 'authCode')); $this->assertEquals('32', XmlParser::getNode($authorizationResponse, 'avsResult')); $this->assertEquals('N', XmlParser::getNode($authorizationResponse, 'cardValidationResult')); }
public function test_60() { $token_hash = array('id' => 'id', 'orderId' => '60', 'amount' => '15000', 'orderSource' => 'ecommerce', 'token' => array('litleToken' => '1712999999999999', 'expDate' => '1112')); $initilaize = new LitleOnlineRequest(); $authorizationResponse = $initilaize->authorizationRequest($token_hash); $this->assertEquals('823', XMLParser::getNode($authorizationResponse, 'response')); $this->assertEquals('Token was invalid', XMLParser::getNode($authorizationResponse, 'message')); }
/** * Make an authorization API request. * * This method wraps the LitleOnlineRequest. * * @param array $hash_in * Request data. * * @return DOMDocument|SimpleXMLElement * The response. */ public function authorizationRequest($hash_in) { return $this->request->authorizationRequest($hash_in); }
public function test_auth_with_card_and_secondary_amount() { $hash_in = array('card' => array('type' => 'VI', 'number' => '4100000000000001', 'expDate' => '1213', 'cardValidationNum' => '1213'), 'secondaryAmount' => '2000', 'orderId' => '2111', 'orderSource' => 'ecommerce', 'id' => '654', 'amount' => '123'); $mock = $this->getMock('litle\\sdk\\LitleXmlMapper'); $mock->expects($this->once())->method('request')->with($this->matchesRegularExpression('/.*<card><type>VI.*<number>4100000000000001.*<expDate>1213.*<cardValidationNum>1213.*/')); $litleTest = new LitleOnlineRequest(); $litleTest->newXML = $mock; $litleTest->authorizationRequest($hash_in); }
public function test_auth_with_applepay_approved() { $hash_in = array('applepay' => array('data' => 'string data here', 'header' => array('applicationData' => '454657413164', 'ephemeralPublicKey' => '1', 'publicKeyHash' => '1234', 'transactionId' => '12345'), 'signature' => 'signature', 'version' => 'version 1'), 'orderId' => '2111', 'orderSource' => 'ecommerce', 'id' => '654', 'amount' => '12312'); $initilaize = new LitleOnlineRequest(); $authorizationResponse = $initilaize->authorizationRequest($hash_in); $response = XmlParser::getNode($authorizationResponse, 'response'); $this->assertEquals('000', $response); }
public function test_36() { $auth_hash = array('id' => '1211', 'orderId' => '36', 'amount' => '20500', 'orderSource' => 'ecommerce', 'card' => array('number' => '375000026600004', 'expDate' => '0512', 'type' => 'AX')); $initilaize = new LitleOnlineRequest(); $authorizationResponse = $initilaize->authorizationRequest($auth_hash); $this->assertEquals('000', XmlParser::getNode($authorizationResponse, 'response')); $this->assertEquals('Approved', XmlParser::getNode($authorizationResponse, 'message')); //test 33A $authReversal_hash = array('id' => '1211', 'litleTxnId' => XmlParser::getNode($authorizationResponse, 'litleTxnId'), 'reportGroup' => 'planets', 'amount' => '10000'); $initilaize = new LitleOnlineRequest(); $authReversalResponse = $initilaize->authReversalRequest($authReversal_hash); $this->assertEquals('001', XmlParser::getNode($authReversalResponse, 'response')); $this->assertEquals('Transaction Received', XmlParser::getNode($authReversalResponse, 'message')); }
public function test_advancedFraudChecks_withoutThreatMetrixSessionId() { //In 8.23, threatMetrixSessionId is optional, but really should be required. //It will be required in 8.24, so I'm making it required here in the schema. //There is no good reason to send an advancedFraudChecks element without a threatMetrixSessionId. $hash_in = array('card' => array('type' => 'VI', 'number' => '4100000000000001', 'expDate' => '1213'), 'orderId' => '12344', 'amount' => '2', 'orderSource' => 'ecommerce', 'debtRepayment' => 'true', 'advancedFraudChecks' => array()); $litleTest = new LitleOnlineRequest(); $this->setExpectedException('InvalidArgumentException', 'Missing Required Field: /threatMetrixSessionId/'); $retOb = $litleTest->authorizationRequest($hash_in); }
public function test_31() { $auth_hash = array('orderId' => '31', 'amount' => '25000', 'orderSource' => 'ecommerce', 'card' => array('number' => '4024720001231239', 'expDate' => '1212', 'type' => 'VI'), 'allowPartialAuth' => 'true', 'healthcareIIAS' => array('healthcareAmounts' => array('totalHealthcareAmount' => '18699', 'RxAmount' => '1000', 'visionAmount' => '15099'), 'IIASFlag' => 'Y')); $initilaize = new LitleOnlineRequest(); $authorizationResponse = $initilaize->authorizationRequest($auth_hash); $this->assertEquals('010', XmlParser::getNode($authorizationResponse, 'response')); $this->assertEquals('Partially Approved', XmlParser::getNode($authorizationResponse, 'message')); $this->assertEquals('18699', XmlParser::getNode($authorizationResponse, 'approvedAmount')); }