Skip to content

Commit

Permalink
Final changes for 8.31 upgrade.
Browse files Browse the repository at this point in the history
  • Loading branch information
DhruvSheth committed Mar 30, 2018
1 parent 8ed5d4f commit 66fcbf7
Show file tree
Hide file tree
Showing 9 changed files with 324 additions and 308 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
reports/
/vendor
composer.lock

/litle_SDK_config*
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ $sale_info = array(
'cardValidationNum' => '349',
'type' => 'MC' )
);
$initilaize = new litle\sdk\LitleOnlineRequest();
$saleResponse =$initilaize->saleRequest($sale_info);
$initialize = new litle\sdk\LitleOnlineRequest();
$saleResponse =$initialize->saleRequest($sale_info);
#display results
echo ("Response: " . (litle\sdk\XmlParser::getNode($saleResponse,'response')) . "<br>");
echo ("Message: " . litle\sdk\XmlParser::getNode($saleResponse,'message') . "<br>");
Expand Down
1 change: 1 addition & 0 deletions litle/sdk/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/litle_SDK_config.ini
/litle_SDK_config*
221 changes: 111 additions & 110 deletions litle/sdk/Test/certification/CertAlphaTest.php

Large diffs are not rendered by default.

73 changes: 35 additions & 38 deletions litle/sdk/Test/certification/CertAuthReversal.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
USE litle\sdk\XmlParser;

define('PRELIVE_URL', 'https://payments.vantivprelive.com/vap/communicator/online');
//define('PRELIVE_URL', 'https://www.testvantivcnp.com/sandbox/communicator/online');

class CertAuthReversal extends \PHPUnit_Framework_TestCase
{
public function test_32()
{
$auth_hash = array(
'url' => PRELIVE_URL,
'url' => PRELIVE_URL,
'orderId' => '32',
'amount' => '10010',
Expand All @@ -52,8 +52,8 @@ public function test_32()
'expDate' => '0112',
'cardValidationNum' => '349',
'type' => 'VI'));
$initilaize = new LitleOnlineRequest();
$authorizationResponse = $initilaize->authorizationRequest($auth_hash);
$initialize = new LitleOnlineRequest();
$authorizationResponse = $initialize->authorizationRequest($auth_hash);
$this->assertEquals('000', XmlParser::getNode($authorizationResponse, 'response'));
$this->assertEquals('Approved', XmlParser::getNode($authorizationResponse, 'message'));
$this->assertEquals('11111 ', XmlParser::getNode($authorizationResponse, 'authCode'));
Expand All @@ -62,30 +62,27 @@ public function test_32()

//test 32A
$capture_hash = array(
'url' => PRELIVE_URL,
'url' => PRELIVE_URL,
'litleTxnId' => (XmlParser::getNode($authorizationResponse, 'litleTxnId')),
'reportGroup' => 'planets');
$initilaize = new LitleOnlineRequest();
$captureResponse = $initilaize->captureRequest($capture_hash);
$initialize = new LitleOnlineRequest();
$captureResponse = $initialize->captureRequest($capture_hash);
$this->assertEquals('000', XmlParser::getNode($captureResponse, 'response'));
$this->assertEquals('Approved', XmlParser::getNode($captureResponse, 'message'));
//test32B
$authReversal_hash = array(
'url' => PRELIVE_URL,
'url' => PRELIVE_URL,
'litleTxnId' => (XmlParser::getNode($authorizationResponse, 'litleTxnId')),
'reportGroup' => 'planets', 'amount' => '5005');
$initilaize = new LitleOnlineRequest();
$authReversalResponse = $initilaize->authReversalRequest($authReversal_hash);
$initialize = new LitleOnlineRequest();
$authReversalResponse = $initialize->authReversalRequest($authReversal_hash);
$this->assertEquals('111', XmlParser::getNode($authReversalResponse, 'response'));
$this->assertEquals('Authorization amount has already been depleted', XmlParser::getNode($authReversalResponse, 'message'));
}

public function test_33()
{
$auth_hash = array(
'url' => PRELIVE_URL,
'url' => PRELIVE_URL,
'orderId' => '33',
'amount' => '20020',
Expand All @@ -104,11 +101,11 @@ public function test_33()
'cardValidationNum' => '261',
'type' => 'MC'),
'cardholderAuthentication' => array('authenticationValue' => 'BwABBJQ1AgAAAAAgJDUCAAAAAAA='));
$initilaize = new LitleOnlineRequest();
$authorizationResponse = $initilaize->authorizationRequest($auth_hash);
$initialize = new LitleOnlineRequest();
$authorizationResponse = $initialize->authorizationRequest($auth_hash);
$this->assertEquals('000', XmlParser::getNode($authorizationResponse, 'response'));
$this->assertEquals('Approved', XmlParser::getNode($authorizationResponse, 'message'));
$this->assertEquals('22222', XmlParser::getNode($authorizationResponse, 'authCode'));
$this->assertEquals('22222 ', XmlParser::getNode($authorizationResponse, 'authCode'));
$this->assertEquals('10', XmlParser::getNode($authorizationResponse, 'avsResult'));
$this->assertEquals('M', XmlParser::getNode($authorizationResponse, 'cardValidationResult'));

Expand All @@ -117,8 +114,8 @@ public function test_33()
'url' => PRELIVE_URL,
'litleTxnId' => (XmlParser::getNode($authorizationResponse, 'litleTxnId')),
'reportGroup' => 'planets');
$initilaize = new LitleOnlineRequest();
$authReversalResponse = $initilaize->authReversalRequest($authReversal_hash);
$initialize = new LitleOnlineRequest();
$authReversalResponse = $initialize->authReversalRequest($authReversal_hash);
$this->assertEquals('000', XmlParser::getNode($authReversalResponse, 'response'));
$this->assertEquals('Approved', XmlParser::getNode($authReversalResponse, 'message'));
}
Expand All @@ -142,11 +139,11 @@ public function test_34()
'expDate' => '0312',
'cardValidationNum' => '758',
'type' => 'DI'));
$initilaize = new LitleOnlineRequest();
$authorizationResponse = $initilaize->authorizationRequest($auth_hash);
$initialize = new LitleOnlineRequest();
$authorizationResponse = $initialize->authorizationRequest($auth_hash);
$this->assertEquals('000', XmlParser::getNode($authorizationResponse, 'response'));
$this->assertEquals('Approved', XmlParser::getNode($authorizationResponse, 'message'));
$this->assertEquals('33333', XmlParser::getNode($authorizationResponse, 'authCode'));
$this->assertEquals('33333 ', XmlParser::getNode($authorizationResponse, 'authCode'));
$this->assertEquals('10', XmlParser::getNode($authorizationResponse, 'avsResult'));
$this->assertEquals('M', XmlParser::getNode($authorizationResponse, 'cardValidationResult'));

Expand All @@ -155,8 +152,8 @@ public function test_34()
'url' => PRELIVE_URL,
'litleTxnId' => (XmlParser::getNode($authorizationResponse, 'litleTxnId')),
'reportGroup' => 'planets');
$initilaize = new LitleOnlineRequest();
$authReversalResponse = $initilaize->authReversalRequest($authReversal_hash);
$initialize = new LitleOnlineRequest();
$authReversalResponse = $initialize->authReversalRequest($authReversal_hash);
$this->assertEquals('000', XmlParser::getNode($authReversalResponse, 'response'));
$this->assertEquals('Approved', XmlParser::getNode($authReversalResponse, 'message'));
}
Expand All @@ -166,7 +163,7 @@ public function test_35()
$auth_hash = array(
'url' => PRELIVE_URL,
'orderId' => '35',
'amount' => '40040',
'amount' => '10100',
'orderSource' => 'ecommerce',
'billToAddress' => array(
'name' => 'Bob Black',
Expand All @@ -179,31 +176,31 @@ public function test_35()
'number' => '375001000000005',
'expDate' => '0412',
'type' => 'AX'));
$initilaize = new LitleOnlineRequest();
$authorizationResponse = $initilaize->authorizationRequest($auth_hash);
$initialize = new LitleOnlineRequest();
$authorizationResponse = $initialize->authorizationRequest($auth_hash);
$this->assertEquals('000', XmlParser::getNode($authorizationResponse, 'response'));
$this->assertEquals('Approved', XmlParser::getNode($authorizationResponse, 'message'));
$this->assertEquals('44444', XmlParser::getNode($authorizationResponse, 'authCode'));
$this->assertEquals('12', XmlParser::getNode($authorizationResponse, 'avsResult'));
$this->assertEquals('44444 ', XmlParser::getNode($authorizationResponse, 'authCode'));
$this->assertEquals('13', XmlParser::getNode($authorizationResponse, 'avsResult'));

//test 35A
$capture_hash = array(
'url' => PRELIVE_URL,
'litleTxnId' => (XmlParser::getNode($authorizationResponse, 'litleTxnId')),
'reportGroup' => 'planets', 'amount' => '20020');
$initilaize = new LitleOnlineRequest();
$captureResponse = $initilaize->captureRequest($capture_hash);
'reportGroup' => 'planets', 'amount' => '5050');
$initialize = new LitleOnlineRequest();
$captureResponse = $initialize->captureRequest($capture_hash);
$this->assertEquals('000', XmlParser::getNode($captureResponse, 'response'));
$this->assertEquals('Approved', XmlParser::getNode($captureResponse, 'message'));
//test35B
$authReversal_hash = array(
'url' => PRELIVE_URL,
'litleTxnId' => (XmlParser::getNode($authorizationResponse, 'litleTxnId')),
'reportGroup' => 'planets', 'amount' => '20020');
$initilaize = new LitleOnlineRequest();
$authReversalResponse = $initilaize->authReversalRequest($authReversal_hash);
$this->assertEquals('000', XmlParser::getNode($authReversalResponse, 'response'));
$this->assertEquals('Approved', XmlParser::getNode($authReversalResponse, 'message'));
'reportGroup' => 'planets', 'amount' => '5050');
$initialize = new LitleOnlineRequest();
$authReversalResponse = $initialize->authReversalRequest($authReversal_hash);
$this->assertEquals('336', XmlParser::getNode($authReversalResponse, 'response'));
$this->assertEquals('Reversal amount does not match authorization amount', XmlParser::getNode($authReversalResponse, 'message'));
}

public function test_36()
Expand All @@ -217,8 +214,8 @@ public function test_36()
'number' => '375000026600004',
'expDate' => '0512',
'type' => 'AX'));
$initilaize = new LitleOnlineRequest();
$authorizationResponse = $initilaize->authorizationRequest($auth_hash);
$initialize = new LitleOnlineRequest();
$authorizationResponse = $initialize->authorizationRequest($auth_hash);
$this->assertEquals('000', XmlParser::getNode($authorizationResponse, 'response'));
$this->assertEquals('Approved', XmlParser::getNode($authorizationResponse, 'message'));

Expand All @@ -227,9 +224,9 @@ public function test_36()
'url' => PRELIVE_URL,
'litleTxnId' => (XmlParser::getNode($authorizationResponse, 'litleTxnId')),
'reportGroup' => 'planets', 'amount' => '10000');
$initilaize = new LitleOnlineRequest();
$authReversalResponse = $initilaize->authReversalRequest($authReversal_hash);
$initialize = new LitleOnlineRequest();
$authReversalResponse = $initialize->authReversalRequest($authReversal_hash);
$this->assertEquals('336', XmlParser::getNode($authReversalResponse, 'response'));
$this->assertEquals('Reversal Amount does not match Authorization amount', XmlParser::getNode($authReversalResponse, 'message'));
$this->assertEquals('Reversal amount does not match authorization amount', XmlParser::getNode($authReversalResponse, 'message'));
}
}
Loading

0 comments on commit 66fcbf7

Please sign in to comment.