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_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('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()
 {
     $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_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_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_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()
 {
     $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_echeckRedepoist_with_echeckToken()
 {
     $hash_in = array('amount' => '123456', 'verify' => 'true', 'orderId' => '12345', 'litleTxnId' => '123456789012345678', 'orderSource' => 'ecommerce', 'echeckToken' => array('accType' => 'Checking', 'litleToken' => '1234565789012', 'routingNum' => '123456789', 'checkNum' => '123455'), 'billToAddress' => array('name' => 'Bob', 'city' => 'lowell', 'state' => 'MA', 'email' => 'litle.com'));
     $initilaize = new LitleOnlineRequest();
     $echeckRedepositResponse = $initilaize->echeckRedepositRequest($hash_in);
     $response = XmlParser::getNode($echeckRedepositResponse, 'response');
     $this->assertEquals('000', $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_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_simple_token_with_echeck()
 {
     $hash_in = array('reportGroup' => 'Planets', 'merchantId' => '101', 'version' => '8.8', 'orderId' => '12344', 'echeckForToken' => array('accNum' => '12344565', 'routingNum' => '123476545'));
     $initilaize = new LitleOnlineRequest();
     $registerTokenResponse = $initilaize->registerTokenRequest($hash_in);
     $message = XmlParser::getAttribute($registerTokenResponse, 'litleOnlineResponse', 'message');
     $this->assertEquals('Valid Format', $message);
 }
 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_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_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();
     $authorizationResponse = $initilaize->authorizationRequest($hash_in);
     $message = XmlParser::getNode($authorizationResponse, '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_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_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_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);
 }
 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);
 }
Пример #24
0
 public function test_round_trip_xml_to_dom_and_back()
 {
     $orig = '<foo>bar</foo>';
     $dom = XmlParser::domParser($orig);
     $after = XmlParser::getDomDocumentAsString($dom);
     $cleanedUp = str_replace('<?xml version="1.0" encoding="UTF-8"?>', '', $after);
     $cleanedUp = str_replace("\n", '', $cleanedUp);
     $this->assertEquals($orig, $cleanedUp);
 }
 public function testSimpleQueryTransaction_responseUnavailable()
 {
     $hash_in = array('id' => 'id', 'origId' => 'ABCD0', 'origActionType' => 'A');
     $initilaize = new LitleOnlineRequest();
     $queryTransactionResponse = $initilaize->queryTransaction($hash_in);
     $response = XmlParser::getNode($queryTransactionResponse, 'response');
     $message = XmlParser::getNode($queryTransactionResponse, 'message');
     $this->assertEquals('151', $response);
     $this->assertEquals('Original transaction not found', $message);
 }
 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'));
 }
Пример #27
0
 function test_5_sale()
 {
     $sale_hash = array('id' => '1211', 'orderId' => '5', 'amount' => '50050', 'orderSource' => 'ecommerce', 'card' => array('number' => '4457010200000007', 'expDate' => '0512', 'cardValidationNum' => '463', 'type' => 'VI'), 'cardholderAuthentication' => array('authenticationValue' => 'BwABBJQ1AgAAAAAgJDUCAAAAAAA='));
     $initilaize = new LitleOnlineRequest();
     $saleResponse = $initilaize->saleRequest($sale_hash);
     $this->assertEquals('000', XmlParser::getNode($saleResponse, 'response'));
     $this->assertEquals('Approved', XmlParser::getNode($saleResponse, 'message'));
     $this->assertEquals('55555 ', XmlParser::getNode($saleResponse, 'authCode'));
     $this->assertEquals('32', XmlParser::getNode($saleResponse, 'avsResult'));
     $this->assertEquals('N', XmlParser::getNode($saleResponse, 'cardValidationResult'));
     //test 5B
     $credit_hash = array('id' => '1211', 'litleTxnId' => XmlParser::getNode($saleResponse, 'litleTxnId'), 'reportGroup' => 'planets');
     $initilaize = new LitleOnlineRequest();
     $creditResponse = $initilaize->creditRequest($credit_hash);
     $this->assertEquals('001', XmlParser::getNode($creditResponse, 'response'));
     $this->assertEquals('Transaction Received', XmlParser::getNode($creditResponse, 'message'));
     //test 5C
     $void_hash = array('id' => '1211', 'litleTxnId' => XmlParser::getNode($creditResponse, 'litleTxnId'), 'reportGroup' => 'planets');
     $initilaize = new LitleOnlineRequest();
     $voidResponse = $initilaize->voidRequest($void_hash);
     $this->assertEquals('001', XmlParser::getNode($voidResponse, 'response'));
     $this->assertEquals('Transaction Received', XmlParser::getNode($voidResponse, 'message'));
 }
Пример #28
0
 /**
  * Get the entire response as a string.
  *
  * This method wraps the XmlParser static call in the SDK.
  *
  * @param DomDocument $dom
  *   The response.
  *
  * @return bool|string
  *   The full response as a string of XML, or FALSE.
  */
 public function getDomDocumentAsString($dom)
 {
     return \litle\sdk\XmlParser::getDomDocumentAsString($dom);
 }
 public function test_paypage_missing_expDate_and_validationNum()
 {
     $hash_in = array('merchantId' => '101', 'version' => '8.8', 'reportGroup' => 'Planets', 'orderId' => '12344', 'amount' => '106', 'orderSource' => 'ecommerce', 'paypage' => array('paypageRegistrationId' => '123456789101112', 'type' => 'VI'));
     $initilaize = new LitleOnlineRequest();
     $creditResponse = $initilaize->creditRequest($hash_in);
     $message = XmlParser::getAttribute($creditResponse, 'litleOnlineResponse', 'message');
     $this->assertEquals("Valid Format", $message);
 }
 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'));
 }