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_echeckRedepoist_missing_litleTxnId()
 {
     $hash_in = array('amount' => '123456', 'verify' => 'true', 'orderId' => '12345', 'orderSource' => 'ecommerce', 'echeckToken' => array('accType' => 'Checking', 'litleToken' => '1234565789012', 'routingNum' => '123456789', 'checkNum' => '123455'), 'billToAddress' => array('name' => 'Bob', 'city' => 'lowell', 'state' => 'MA', 'email' => 'litle.com'));
     $litleTest = new LitleOnlineRequest();
     $this->setExpectedException('InvalidArgumentException', 'Missing Required Field: /litleTxnId/');
     $retOb = $litleTest->echeckRedepositRequest($hash_in);
 }
 public function test_token_echeck_missing_required()
 {
     $hash_in = array('merchantId' => '101', 'version' => '8.8', 'reportGroup' => 'Planets', 'orderId' => '12344', 'echeckForToken' => array('routingNum' => '132344565'));
     $litleTest = new LitleOnlineRequest();
     $this->setExpectedException('InvalidArgumentException', 'Missing Required Field: /accNum/');
     $retOb = $litleTest->registerTokenRequest($hash_in);
 }
 public function test_simple_forceCapture_with_token()
 {
     $hash_in = array('merchantId' => '101', 'version' => '8.8', 'reportGroup' => 'Planets', 'litleTxnId' => '123456', 'orderId' => '12344', 'amount' => '106', 'orderSource' => 'ecommerce', 'token' => array('litleToken' => '123456789101112', 'expDate' => '1210', 'cardValidationNum' => '555', 'type' => 'VI'));
     $initilaize = new LitleOnlineRequest();
     $forceCaptureResponse = $initilaize->forceCaptureRequest($hash_in);
     $message = XmlParser::getAttribute($forceCaptureResponse, 'litleOnlineResponse', 'message');
     $this->assertEquals('Valid Format', $message);
 }
 public function test_echeckSale_with_shipto()
 {
     $hash_in = array('amount' => '123456', 'verify' => 'true', 'orderId' => '12345', 'orderSource' => 'ecommerce', 'echeck' => array('accType' => 'Checking', 'accNum' => '12345657890', 'routingNum' => '123456789', 'checkNum' => '123455'), 'billToAddress' => array('name' => 'Bob', 'city' => 'lowell', 'state' => 'MA', 'email' => 'litle.com'), 'shipToAddress' => array('name' => 'Bob', 'city' => 'lowell', 'state' => 'MA', 'email' => 'litle.com'));
     $initilaize = new LitleOnlineRequest();
     $echeckSaleResponse = $initilaize->echeckSaleRequest($hash_in);
     $response = XmlParser::getNode($echeckSaleResponse, 'response');
     $this->assertEquals('000', $response);
 }
 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_simple()
 {
     $hash_in = array('id' => '1211', 'merchantId' => '101', 'version' => '8.14', 'reportGroup' => 'Planets', 'orderId' => '12344', 'litleToken' => '123456789101112', 'cardValidationNum' => '123');
     $initilaize = new LitleOnlineRequest();
     $updateCardValidationNumOnTokenResponse = $initilaize->updateCardValidationNumOnToken($hash_in);
     $message = XmlParser::getAttribute($updateCardValidationNumOnTokenResponse, 'litleOnlineResponse', 'message');
     $this->assertEquals('Valid Format', $message);
 }
 public function test_simple_capture_with_partial()
 {
     $hash_in = array('litleTxnId' => '1234567891234567891', 'patial' => 'true', 'amount' => '123');
     $initilaize = new LitleOnlineRequest();
     $captureResponse = $initilaize->captureRequest($hash_in);
     $message = XmlParser::getAttribute($captureResponse, 'litleOnlineResponse', 'response');
     $this->assertEquals('0', $message);
 }
 public function test_simple()
 {
     $hash_in = array('subscriptionId' => '1', 'planCode' => '2', 'billToAddress' => array('addressLine1' => '3'), 'card' => array('type' => 'VI', 'number' => '4100000000000000', 'expDate' => '1213', 'cardValidationNum' => '1213'), 'billingDate' => '2013-12-17');
     $initialize = new LitleOnlineRequest();
     $updateSubscriptionResponse = $initialize->updateSubscription($hash_in);
     $message = XmlParser::getAttribute($updateSubscriptionResponse, 'litleOnlineResponse', 'message');
     $this->assertEquals('Valid Format', $message);
 }
 public function test_simple()
 {
     $hash_in = array('planCode' => '1', 'active' => 'false');
     $initialize = new LitleOnlineRequest();
     $updatePlanResponse = $initialize->updatePlan($hash_in);
     $message = XmlParser::getAttribute($updatePlanResponse, 'litleOnlineResponse', 'message');
     $this->assertEquals('Valid Format', $message);
 }
 public function test_simple_credit_with_litleTxnId_AndSecondaryAmount()
 {
     $hash_in = array('id' => 'id', 'reportGroup' => 'planets', 'litleTxnId' => '1234567891234567891', 'secondaryAmount' => '100');
     $initilaize = new LitleOnlineRequest();
     $creditResponse = $initilaize->creditRequest($hash_in);
     $message = XmlParser::getAttribute($creditResponse, 'litleOnlineResponse', 'response');
     $this->assertEquals("0", $message);
 }
 public function test_simple()
 {
     $hash_in = array('subscriptionId' => '2');
     $initialize = new LitleOnlineRequest();
     $cancelSubscriptionResponse = $initialize->cancelSubscription($hash_in);
     $message = XmlParser::getAttribute($cancelSubscriptionResponse, 'litleOnlineResponse', 'message');
     $this->assertEquals('Valid Format', $message);
 }
 public function test_authInfo()
 {
     $hash_in = array('orderId' => '12344', 'amount' => '106', 'authInformation' => array('authDate' => '2002-10-09', 'authCode' => '543216', 'authAmount' => '12345', 'fraudResult' => array('avsResult' => '12', 'cardValidationResult' => '123', 'authenticationResult' => '1', 'advancedAVSResult' => '123')), 'orderSource' => 'ecommerce', 'card' => array('type' => 'VI', 'number' => '4100000000000000', 'expDate' => '1210'));
     $initilaize = new LitleOnlineRequest();
     $captureGivenAuthResponse = $initilaize->captureGivenAuthRequest($hash_in);
     $message = XmlParser::getNode($captureGivenAuthResponse, 'message');
     $this->assertEquals('Approved', $message);
 }
 public function test_invalid_field()
 {
     $hash_in = array('paypal' => array("payerId" => '123', "token" => '12321312', "transactionId" => '123123'), 'id' => '1211', 'orderId' => '2111', 'nonexistant' => 'novalue', 'reportGroup' => 'Planets', 'orderSource' => 'ecommerce', 'amount' => '123');
     $initilaize = new LitleOnlineRequest();
     $saleResponse = $initilaize->saleRequest($hash_in);
     $message = XmlParser::getNode($saleResponse, 'message');
     $this->assertEquals('Approved', $message);
 }
 public function test_simple()
 {
     $hash_in = array('planCode' => '1', 'name' => '2', 'intervalType' => 'MONTHLY', 'amount' => '1000');
     $initialize = new LitleOnlineRequest();
     $createPlanResponse = $initialize->createPlan($hash_in);
     $message = XmlParser::getAttribute($createPlanResponse, 'litleOnlineResponse', 'message');
     $this->assertEquals('Valid Format', $message);
 }
 public function test_simple_captureGivenAuth_secondary_amount()
 {
     $hash_in = array('orderId' => '12344', 'amount' => '106', 'secondaryAmount' => '2000', 'authInformation' => array('authDate' => '2002-10-09', 'authCode' => '543216', 'authAmount' => '12345'), 'orderSource' => 'ecommerce', 'card' => array('type' => 'VI', 'number' => '4100000000000000', 'expDate' => '1210'));
     $initilaize = new LitleOnlineRequest();
     $captureGivenAuthResponse = $initilaize->captureGivenAuthRequest($hash_in);
     $message = XmlParser::getNode($captureGivenAuthResponse, 'message');
     $this->assertEquals('Approved', $message);
 }
 public function test_simple_forceCapture_with_secondary_amount()
 {
     $hash_in = array('merchantId' => '101', 'version' => '8.8', 'reportGroup' => 'Planets', 'litleTxnId' => '123456', 'orderId' => '12344', 'amount' => '106', 'secondaryAmount' => '2000', 'orderSource' => 'ecommerce', 'card' => array('type' => 'VI', 'number' => '4100000000000000', 'expDate' => '1210'));
     $initilaize = new LitleOnlineRequest();
     $forceCaptureResponse = $initilaize->forceCaptureRequest($hash_in);
     $response = XmlParser::getAttribute($forceCaptureResponse, 'litleOnlineResponse', 'response');
     $this->assertEquals('000', $response);
 }
 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->unload($hash_in);
     $message = XmlParser::getAttribute($response, 'litleOnlineResponse', 'message');
     $this->assertEquals('Valid Format', $message);
 }
 public function test_simple()
 {
     $hash_in = array('litleTxnId' => '123456789012345678');
     $initilaize = new LitleOnlineRequest();
     $refundReversalResponse = $initilaize->echeckVoidRequest($hash_in);
     $response = XmlParser::getAttribute($refundReversalResponse, 'litleOnlineResponse', 'response');
     $this->assertEquals('0', $response);
 }
 public function test_amexAggregator()
 {
     $hash_in = array('amount' => '2000', 'orderId' => '12344', 'orderSource' => 'ecommerce', 'processingInstuctions' => array('bypassVelocityCheck' => 'yes'), 'card' => array('type' => 'VI', 'number' => '4100000000000000', 'expDate' => '1210'), 'amexAggregatorData' => array('sellerMerchantCategoryCode' => '1234', 'sellerId' => '1234Id'));
     $initilaize = new LitleOnlineRequest();
     $creditResponse = $initilaize->creditRequest($hash_in);
     $response = XmlParser::getNode($creditResponse, 'response');
     $this->assertEquals('000', $response);
 }
 public function test_simple_echeckSale_secondaryAmount_With_CCD_longerthan80()
 {
     $hash_in = array('amount' => '123456', 'secondaryAmount' => '2000', 'verify' => 'true', 'orderId' => '12345', 'orderSource' => 'ecommerce', 'echeck' => array('accType' => 'Checking', 'accNum' => '12345657890', 'routingNum' => '123456789', 'checkNum' => '123455', 'ccdPaymentInformation' => '000000000000000000000000000000000000000000000000000000000000000000000000000000000'), 'billToAddress' => array('name' => 'Bob', 'city' => 'lowell', 'state' => 'MA', 'email' => 'litle.com'));
     $initilaize = new LitleOnlineRequest();
     $echeckSaleResponse = $initilaize->echeckSaleRequest($hash_in);
     $message = XmlParser::getAttribute($echeckSaleResponse, 'litleOnlineResponse', 'message');
     $this->assertRegExp('/Error validating xml data against the schema/', $message);
 }
 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);
 }
 function test_simple_authreversal_fields_out_of_order()
 {
     $hash_in = array('amount' => '123', 'payPalNotes' => 'Notes', 'litleTxnId' => '12345678000');
     $initilaize = new LitleOnlineRequest();
     $authReversalResponse = $initilaize->authReversalRequest($hash_in);
     $response = XmlParser::getNode($authReversalResponse, 'response');
     $this->assertEquals('000', $response);
 }
 public function test_simple_token_applepay()
 {
     $hash_in = array('merchantId' => '101', 'version' => '8.8', 'reportGroup' => 'Planets', 'orderId' => '12344', 'applepay' => array('data' => 'string data here', 'header' => array('applicationData' => '454657413164', 'ephemeralPublicKey' => '1', 'publicKeyHash' => '1234', 'transactionId' => '12345'), 'signature' => 'signature', 'version' => 'version 1'));
     $initilaize = new LitleOnlineRequest();
     $registerTokenResponse = $initilaize->registerTokenRequest($hash_in);
     $message = XmlParser::getAttribute($registerTokenResponse, 'litleOnlineResponse', 'message');
     $this->assertEquals('Valid Format', $message);
 }
 public function test_merchantData()
 {
     $hash_in = array('amount' => '123', 'orderId' => '123', 'orderSource' => 'ecommerce', 'id' => 'id', 'merchantData' => array('campaign' => 'camping'), 'echeckToken' => array('accType' => 'Checking', 'routingNum' => '123123', 'litleToken' => '1234565789012', 'checkNum' => '123455'));
     $mock = $this->getMock('litle\\sdk\\LitleXmlMapper');
     $mock->expects($this->once())->method('request')->with($this->matchesRegularExpression('/.*<\\/echeckToken>.*<merchantData>.*<campaign>camping<\\/campaign>.*<\\/merchantData>/'));
     $litleTest = new LitleOnlineRequest();
     $litleTest->newXML = $mock;
     $litleTest->echeckVerificationRequest($hash_in);
 }
 public function test_simple()
 {
     $hash_in = array('orderId' => '1', 'orderSource' => 'ECOMMERCE', 'id' => 'id', '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.*<orderSource>ECOMMERCE.*<card.*type.*VI.*/'));
     $litleTest = new LitleOnlineRequest();
     $litleTest->newXML = $mock;
     $litleTest->balanceInquiry($hash_in);
 }
 public function test_ActiveIsOptional()
 {
     $hash_in = array('planCode' => '1', 'name' => '2', 'id' => 'id', 'intervalType' => 'MONTHLY', 'amount' => '1000', 'numberOfPayments' => '5', 'trialNumberOfIntervals' => '6', 'trialIntervalType' => 'WEEKLY');
     $mock = $this->getMock('litle\\sdk\\LitleXmlMapper');
     $mock->expects($this->once())->method('request')->with($this->logicalNot($this->matchesRegularExpression('/.*active.*/')));
     $litleTest = new LitleOnlineRequest();
     $litleTest->newXML = $mock;
     $litleTest->createPlan($hash_in);
 }
 public function test_simple()
 {
     $hash_in = array('subscriptionId' => '1', 'id' => 'id');
     $mock = $this->getMock('litle\\sdk\\LitleXmlMapper');
     $mock->expects($this->once())->method('request')->with($this->matchesRegularExpression('/.*<subscriptionId>1.*/'));
     $litleTest = new LitleOnlineRequest();
     $litleTest->newXML = $mock;
     $litleTest->cancelSubscription($hash_in);
 }
 public function test_loggedInUser()
 {
     $hash_in = array('id' => 'id', 'litleTxnId' => '123123', 'merchantSdk' => 'PHP;8.14.0', 'reportGroup' => 'Planets', '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->voidRequest($hash_in);
 }
 public function test_loggedInUser()
 {
     $hash_in = array('id' => 'id', 'loggedInUser' => 'gdake', 'merchantSdk' => 'PHP;8.14.0', 'orderId' => '1', 'litleToken' => '123456789101112', 'cardValidationNum' => '123');
     $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->updateCardValidationNumOnToken($hash_in);
 }