Skip to content

Commit

Permalink
Merge pull request #57 from Sushamaghadage123/US1662401
Browse files Browse the repository at this point in the history
promoting changes for litle php sdk v8.32 and v8.33
  • Loading branch information
isunnapud authored Oct 19, 2023
2 parents a732e51 + 78fe387 commit 9e49dcd
Show file tree
Hide file tree
Showing 20 changed files with 856 additions and 58 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
= LitleOnline CHANGELOG

==version v8.33(October 18, 2023)
• Change : Added New Enum -foreignRetailerIndicatorEnum with value F .
• Change : Added New Enum foreignRetailerIndicatorEnum is added in Capture, forceCapture,captureGivenAuth,sale request.
• Change : Added New Enum -authIndicatorEnum with value Estimated, Incremental.
• Change : Added new element amount, authIndicator in authorization.

==version V8.32(October 18, 2023)
• Change : New elements retailerAddress added of type contact in authorization , captureGivenAuth and sale Request.
• Change : New elements additionalCOFData added of type additionalCOFData in authorization , captureGivenAuth and sale
request.
• Change : New elements totalPaymentCount, paymentType, uniqueId,frequencyOfMIT,validationReference, sequenceIndicator are added for new element additionalCOFData
• Change : Added new elements businessIndicator, merchantCategoryCode, crypto in authorization, captureGivenAuth and sale
request.
• Change : Added new subelements SellerId, URL in existing complex type Contact.
• Change : Added New Enum businessIndicatorEnum with values consumerBillPayment, buyOnlinePickUpInStore,
highRiskSecuritiesPurchase, fundTransfer, walletTransfer.
• Change : Added New Enum paymentTypeEnum with values Fixed Amount, Variable Amount.
• Change : Added New Enum frequencyOfMITEnum with values Daily, Weekly, BiWeekly, Monthly, Quarterly, BiAnnually,
Annually, UNSCHEDULED.

==version 8.31.2
* Feature: phpseclib v8

Expand Down
4 changes: 2 additions & 2 deletions litle/sdk/LitleOnline.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
*/

namespace litle\sdk;
define('CURRENT_XML_VERSION', '8.31');
define('CURRENT_SDK_VERSION', 'PHP;8.31.0');
define('CURRENT_XML_VERSION', '8.33');
define('CURRENT_SDK_VERSION', 'PHP;8.33.0');
define('MAX_TXNS_PER_BATCH', 100000);
define('MAX_TXNS_PER_REQUEST', 500000);
define('LITLE_CONFIG_LIST', 'user,password,merchantId,timeout,proxy,reportGroup,version,url,litle_requests_path,batch_requests_path,sftp_username,sftp_password,batch_url,tcp_port,tcp_ssl,tcp_timeout,print_xml');
Expand Down
28 changes: 25 additions & 3 deletions litle/sdk/LitleOnlineRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ public static function getCardResponse($code)
public function authorizationRequest($hash_in)
{
if (isset($hash_in['litleTxnId'])) {
$hash_out = array('litleTxnId' => (XmlFields::returnArrayValue($hash_in, 'litleTxnId')));
$hash_out = array('litleTxnId' => (XmlFields::returnArrayValue($hash_in, 'litleTxnId')),
'amount' => Checker::requiredField(XmlFields::returnArrayValue($hash_in, 'amount')),
'authIndicator' => Checker::requiredField(XmlFields::returnArrayValue($hash_in, 'authIndicator')));
} else {
$hash_out = array(
'orderId' => Checker::requiredField(XmlFields::returnArrayValue($hash_in, 'orderId')),
Expand All @@ -83,6 +85,8 @@ public function authorizationRequest($hash_in)
'customerInfo' => (XmlFields::customerInfo(XmlFields::returnArrayValue($hash_in, 'customerInfo'))),
'billToAddress' => (XmlFields::contact(XmlFields::returnArrayValue($hash_in, 'billToAddress'))),
'shipToAddress' => (XmlFields::contact(XmlFields::returnArrayValue($hash_in, 'shipToAddress'))),
'retailerAddress' => (XmlFields::contact(XmlFields::returnArrayValue($hash_in, 'retailerAddress'))),
'additionalCOFData' => (XmlFields::additionalCOFData(XmlFields::returnArrayValue($hash_in, 'additionalCOFData'))),
'card' => (XmlFields::cardType(XmlFields::returnArrayValue($hash_in, 'card'))),
'paypal' => (XmlFields::payPal(XmlFields::returnArrayValue($hash_in, 'paypal'))),
'token' => (XmlFields::cardTokenType(XmlFields::returnArrayValue($hash_in, 'token'))),
Expand All @@ -109,6 +113,10 @@ public function authorizationRequest($hash_in)
'processingType' => XmlFields::returnArrayValue($hash_in, 'processingType'),
'originalNetworkTransactionId' => XmlFields::returnArrayValue($hash_in, 'originalNetworkTransactionId'),
'originalTransactionAmount' => XmlFields::returnArrayValue($hash_in, 'originalTransactionAmount'),
'merchantCategoryCode' => XmlFields::returnArrayValue($hash_in, 'merchantCategoryCode'),
'businessIndicator' => XmlFields::returnArrayValue($hash_in, 'businessIndicator'),
'crypto' => XmlFields::returnArrayValue($hash_in, 'crypto'),
'authIndicator' => XmlFields::returnArrayValue($hash_in, 'authIndicator')
);
}
$choice_hash = array(XmlFields::returnArrayValue($hash_out, 'card'), XmlFields::returnArrayValue($hash_out, 'paypal'), XmlFields::returnArrayValue($hash_out, 'token'), XmlFields::returnArrayValue($hash_out, 'paypage'), XmlFields::returnArrayValue($hash_out, 'applepay'), XmlFields::returnArrayValue($hash_out, 'mpos'));
Expand All @@ -129,6 +137,8 @@ public function saleRequest($hash_in)
'customerInfo' => XmlFields::customerInfo(XmlFields::returnArrayValue($hash_in, 'customerInfo')),
'billToAddress' => XmlFields::contact(XmlFields::returnArrayValue($hash_in, 'billToAddress')),
'shipToAddress' => XmlFields::contact(XmlFields::returnArrayValue($hash_in, 'shipToAddress')),
'retailerAddress' => XmlFields::contact(XmlFields::returnArrayValue($hash_in, 'retailerAddress')),
'additionalCOFData' => XmlFields::additionalCOFData(XmlFields::returnArrayValue($hash_in, 'additionalCOFData')),
'card' => XmlFields::cardType(XmlFields::returnArrayValue($hash_in, 'card')),
'paypal' => XmlFields::payPal(XmlFields::returnArrayValue($hash_in, 'paypal')),
'token' => XmlFields::cardTokenType(XmlFields::returnArrayValue($hash_in, 'token')),
Expand Down Expand Up @@ -159,6 +169,10 @@ public function saleRequest($hash_in)
'processingType' => XmlFields::returnArrayValue($hash_in, 'processingType'),
'originalNetworkTransactionId' => XmlFields::returnArrayValue($hash_in, 'originalNetworkTransactionId'),
'originalTransactionAmount' => XmlFields::returnArrayValue($hash_in, 'originalTransactionAmount'),
'merchantCategoryCode' => XmlFields::returnArrayValue($hash_in, 'merchantCategoryCode'),
'businessIndicator' => XmlFields::returnArrayValue($hash_in, 'businessIndicator'),
'crypto' => XmlFields::returnArrayValue($hash_in, 'crypto'),
'foreignRetailerIndicator' => XmlFields::returnArrayValue($hash_in, 'foreignRetailerIndicator'),
);

$choice_hash = array($hash_out['card'], $hash_out['paypal'], $hash_out['token'], $hash_out['paypage'], $hash_out['applepay'], $hash_out['mpos']);
Expand Down Expand Up @@ -252,6 +266,7 @@ public function forceCaptureRequest($hash_in)
'merchantData' => (XmlFields::merchantData(XmlFields::returnArrayValue($hash_in, 'merchantData'))),
'debtRepayment' => XmlFields::returnArrayValue($hash_in, 'debtRepayment'),
'processingType' => XmlFields::returnArrayValue($hash_in, 'processingType'),
'foreignRetailerIndicator' => XmlFields::returnArrayValue($hash_in, 'foreignRetailerIndicator'),
);

$choice_hash = array(XmlFields::returnArrayValue($hash_out, 'card'), XmlFields::returnArrayValue($hash_out, 'paypal'), XmlFields::returnArrayValue($hash_out, 'token'), XmlFields::returnArrayValue($hash_out, 'paypage'), XmlFields::returnArrayValue($hash_out, 'mpos'));
Expand All @@ -270,7 +285,8 @@ public function captureRequest($hash_in)
'enhancedData' => XmlFields::enhancedData(XmlFields::returnArrayValue($hash_in, 'enhancedData')),
'processingInstructions' => XmlFields::processingInstructions(XmlFields::returnArrayValue($hash_in, 'processingInstructions')),
'payPalOrderComplete' => XmlFields::returnArrayValue($hash_in, 'payPalOrderComplete'),
'payPalNotes' => XmlFields::returnArrayValue($hash_in, 'payPalNotes'));
'payPalNotes' => XmlFields::returnArrayValue($hash_in, 'payPalNotes'),
'foreignRetailerIndicator' => XmlFields::returnArrayValue($hash_in, 'foreignRetailerIndicator'));
$captureResponse = $this->processRequest($hash_out, $hash_in, 'capture');

return $captureResponse;
Expand All @@ -287,6 +303,8 @@ public function captureGivenAuthRequest($hash_in)
'orderSource' => Checker::requiredField(XmlFields::returnArrayValue($hash_in, 'orderSource')),
'billToAddress' => XmlFields::contact(XmlFields::returnArrayValue($hash_in, 'billToAddress')),
'shipToAddress' => XmlFields::contact(XmlFields::returnArrayValue($hash_in, 'shipToAddress')),
'retailerAddress' => XmlFields::contact(XmlFields::returnArrayValue($hash_in, 'retailerAddress')),
'additionalCOFData' => XmlFields::additionalCOFData(XmlFields::returnArrayValue($hash_in, 'additionalCOFData')),
'card' => XmlFields::cardType(XmlFields::returnArrayValue($hash_in, 'card')),
'token' => XmlFields::cardTokenType(XmlFields::returnArrayValue($hash_in, 'token')),
'paypage' => XmlFields::cardPaypageType(XmlFields::returnArrayValue($hash_in, 'paypage')),
Expand All @@ -302,7 +320,11 @@ public function captureGivenAuthRequest($hash_in)
'debtRepayment' => XmlFields::returnArrayValue($hash_in, 'debtRepayment'),
'processingType' => XmlFields::returnArrayValue($hash_in, 'processingType'),
'originalNetworkTransactionId' => XmlFields::returnArrayValue($hash_in, 'originalNetworkTransactionId'),
'originalTransactionAmount' => XmlFields::returnArrayValue($hash_in, 'originalTransactionAmount')
'originalTransactionAmount' => XmlFields::returnArrayValue($hash_in, 'originalTransactionAmount'),
'merchantCategoryCode' => XmlFields::returnArrayValue($hash_in, 'merchantCategoryCode'),
'businessIndicator' => XmlFields::returnArrayValue($hash_in, 'businessIndicator'),
'crypto' => XmlFields::returnArrayValue($hash_in, 'crypto'),
'foreignRetailerIndicator' => XmlFields::returnArrayValue($hash_in, 'foreignRetailerIndicator'),
);

$choice_hash = array($hash_out['card'], $hash_out['token'], $hash_out['paypage'], $hash_out['mpos']);
Expand Down
113 changes: 108 additions & 5 deletions litle/sdk/Test/functional/AuthFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

namespace litle\sdk\Test\functional;

use http\Message;
use litle\sdk\LitleOnlineRequest;
use litle\sdk\XmlParser;

Expand Down Expand Up @@ -68,7 +69,7 @@ public function test_simple_auth_with_paypal()

public function test_simple_auth_with_litleTxnId()
{
$hash_in = array('reportGroup' => 'planets', 'litleTxnId' => '1234567891234567891');
$hash_in = array('reportGroup' => 'planets', 'litleTxnId' => '1234567891234567891','amount' => '124','authIndicator'=>'Estimated');

$initilaize = new LitleOnlineRequest();
$authorizationResponse = $initilaize->authorizationRequest($hash_in);
Expand Down Expand Up @@ -203,7 +204,7 @@ public function test_auth_with_applepay_approved()
'orderId' => '2111',
'orderSource' => 'ecommerce',
'id' => '654',
'amount' => '12312');
'amount' => '1231');

$initilaize = new LitleOnlineRequest();
$authorizationResponse = $initilaize->authorizationRequest($hash_in);
Expand All @@ -215,7 +216,7 @@ public function test_auth_with_processingType()
{
$hash_in = array(
'card' => array('type' => 'VI',
'number' => '4100200300011001',
'number' => '4100200300011000',
'expDate' => '0521',),
'orderId' => '2111',
'amount' => '4999',
Expand All @@ -236,7 +237,7 @@ public function test_auth_with_originalNetworkTransactionId()
{
$hash_in = array(
'card' => array('type' => 'VI',
'number' => '4100200300011001',
'number' => '4100200300011000',
'expDate' => '0521',
'cardValidationNum' => '463',),
'orderId' => '2111',
Expand All @@ -254,7 +255,7 @@ public function test_auth_with_originalTransactionAmount()
{
$hash_in = array(
'card' => array('type' => 'VI',
'number' => '4100200300011001',
'number' => '4100200300011000',
'expDate' => '0521',
'cardValidationNum' => '463',),
'orderId' => '2111',
Expand All @@ -268,4 +269,106 @@ public function test_auth_with_originalTransactionAmount()
$response = XmlParser::getNode($authorizationResponse, 'response');
$this->assertEquals('000', $response);
}
public function test_auth_with_v8_32()
{
$hash_in = array(
'card' => array(
'type' => 'VI',
'number' => '4005518220000002',
'expDate' => '0150',
'cardValidationNum' => '987',
),
'id'=>'0001',
'orderId' => '82364_cnpApiAuth',
'amount' => '2870',
'orderSource' => 'telephone',
'billToAddress' => array(
'name' => 'David Berman A',
'addressLine1' => '10 Main Street',
'city' => 'San Jose',
'state' => 'ca',
'zip' => '95032',
'country' => 'USA',
'email' => '[email protected]',
'phone' => '781-270-1111',
'sellerId' => '21234234A1',
'url' => 'www.google.com',
),
'shipToAddress' => array(
'name' => 'Raymond J. Johnson Jr. B',
'addressLine1' => '123 Main Street',
'city' => 'McLean',
'state' => 'VA',
'zip' => '22102',
'country' => 'USA',
'email' => '[email protected]',
'phone' => '978-275-0000',
'sellerId' => '21234234A2',
'url' => 'www.google.com',
),
'retailerAddress' => array(
'name' => 'John doe',
'addressLine1' => '123 Main Street',
'addressLine2' => '123 Main Street',
'addressLine3' => '123 Main Street',
'city' => 'Cincinnati',
'state' => 'OH',
'zip' => '45209',
'country' => 'USA',
'email' => '[email protected]',
'phone' => '1234562783',
'sellerId' => '21234234A12345678910',
'companyName' => 'Google INC',
'url' => 'https://www.youtube.com/results?search_query',
),
'additionalCOFData' => array(
'totalPaymentCount' => 'ND',
'paymentType' => 'Fixed Amount',
'uniqueId' => '234GTYH654RF13',
'frequencyOfMIT' => 'Annually',
'validationReference' => 'ANBH789UHY564RFC@EDB',
'sequenceIndicator' => '86',
),
'merchantCategoryCode' => '5964',
'businessIndicator' => 'walletTransfer',
'crypto' => 'true',
);
$initilaize = new LitleOnlineRequest();
$authorizationResponse = $initilaize->authorizationRequest($hash_in);
$response = XmlParser::getNode($authorizationResponse, 'response');
$this->assertEquals('000', $response);
}

public function test_auth_with_changes_v8_33()
{
$hash_in = array(
'card' => array(
'type' => 'VI',
'number' => '4005518220000002',
'expDate' => '0150',
'cardValidationNum' => '987',
),
'id'=>'0001',
'orderId' => '82364_cnpApiAuth',
'amount' => '2870',
'orderSource' => 'telephone',
'additionalCOFData' => array(
'totalPaymentCount' => 'ND',
'paymentType' => 'Fixed Amount',
'uniqueId' => '234GTYH654RF13',
'frequencyOfMIT' => 'Annually',
'validationReference' => 'ANBH789UHY564RFC@EDB',
'sequenceIndicator' => '86',
),
'merchantCategoryCode' => '5964',
'businessIndicator' => 'walletTransfer',
'crypto' => 'true',
'authIndicator' => 'Estimated'

);
$initilaize = new LitleOnlineRequest();
$authorizationResponse = $initilaize->authorizationRequest($hash_in);
$response = XmlParser::getNode($authorizationResponse, 'response');
$this->assertEquals('000', $response);
}
}
Loading

0 comments on commit 9e49dcd

Please sign in to comment.