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_echeckCredit_with_echeckToken()
 {
     $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'));
     $initilaize = new LitleOnlineRequest();
     $echeckCreditResponse = $initilaize->echeckCreditRequest($hash_in);
     $response = XmlParser::getNode($echeckCreditResponse, 'message');
     $this->assertEquals('Approved', $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);
 }
 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_echeckSale_secondaryAmount_With_CCD()
 {
     $hash_in = array('amount' => '123456', 'secondaryAmount' => '2000', 'verify' => 'true', 'orderId' => '12345', 'orderSource' => 'ecommerce', 'echeck' => array('accType' => 'Checking', 'accNum' => '12345657890', 'routingNum' => '123456789', 'checkNum' => '123455', 'ccdPaymentInformation' => 'ccd'), 'billToAddress' => 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_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_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_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_credit_with_secondary_amount()
 {
     $hash_in = array('id' => 'id', 'card' => array('type' => 'VI', 'number' => '4100000000000000', 'expDate' => '1213', 'cardValidationNum' => '1213'), 'id' => '1211', 'orderId' => '2111', 'reportGroup' => 'Planets', 'orderSource' => 'ecommerce', 'amount' => '123', 'secondaryAmount' => '1234');
     $initilaize = new LitleOnlineRequest();
     $creditResponse = $initilaize->creditRequest($hash_in);
     $response = XmlParser::getNode($creditResponse, 'response');
     $this->assertEquals('001', $response);
 }
 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 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'));
 }
Пример #13
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'));
 }
 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'));
 }
Пример #15
0
 /**
  * Get an element value from the response.
  *
  * This method wraps the XmlParser static call in the SDK.
  *
  * @param DomDocument $dom
  *   The response.
  * @param string $elementName
  *   The element/tag to match.
  *
  * @return string
  *   The value of the last matching element in the document.
  */
 public function getNode($dom, $elementName)
 {
     return \litle\sdk\XmlParser::getNode($dom, $elementName);
 }
 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_simple_sale_with_AdvancedFraudCheckWithCustomAttribute()
 {
     $hash_in = array('card' => array('type' => 'VI', 'number' => '4100000000000000', 'expDate' => '1213', 'cardValidationNum' => '1213'), 'id' => '654', 'orderId' => '2111', 'orderSource' => 'ecommerce', 'amount' => '123', 'advancedFraudChecks' => array('threatMetrixSessionId' => 'abc123', 'customAttribute1' => '1', 'customAttribute2' => '2', 'customAttribute3' => '3', 'customAttribute4' => '4', 'customAttribute5' => '5'));
     $initilaize = new LitleOnlineRequest();
     $saleResponse = $initilaize->saleRequest($hash_in);
     $response = XmlParser::getNode($saleResponse, 'response');
     $this->assertEquals('000', $response);
 }
 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'));
 }