From 2383c728c078f760808da3b8672a4d1b4e307fb7 Mon Sep 17 00:00:00 2001 From: pshah91 Date: Fri, 7 Mar 2014 11:06:06 -0500 Subject: [PATCH] commiting all change --- CHANGELOG | 3 +++ lib/LitleOnlineRequest.php | 15 ++++++++++----- lib/XmlFields.php | 18 ++++++++++++++++++ test/unit/test_XmlFields.php | 15 +++++++++++++++ 4 files changed, 46 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d11e1480..da8eb6ad 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ = LitleOnline CHANGELOG +== version 8.25.0 (March 7, 2014) +* Feature: Added support for ROAM: Authorization, ForceCapture, CaptureGivenAuth, Sale, Credit + == version 8.24.0 (February 13, 2014) * Feature: add triggered rules for advancedFraudCheckResult diff --git a/lib/LitleOnlineRequest.php b/lib/LitleOnlineRequest.php index 0499fb9d..3e0d726d 100644 --- a/lib/LitleOnlineRequest.php +++ b/lib/LitleOnlineRequest.php @@ -51,6 +51,7 @@ public function authorizationRequest($hash_in) 'paypal'=>(XmlFields::payPal(XmlFields::returnArrayValue($hash_in,'paypal'))), 'token'=>(XmlFields::cardTokenType(XmlFields::returnArrayValue($hash_in,'token'))), 'paypage'=>(XmlFields::cardPaypageType(XmlFields::returnArrayValue($hash_in,'paypage'))), + 'mpos'=>(XmlFields::mposType(XmlFields::returnArrayValue($hash_in,'mpos'))), 'billMeLaterRequest'=>(XmlFields::billMeLaterRequest(XmlFields::returnArrayValue($hash_in,'billMeLaterRequest'))), 'cardholderAuthentication'=>(XmlFields::fraudCheckType(XmlFields::returnArrayValue($hash_in,'cardholderAuthentication'))), 'processingInstructions'=>(XmlFields::processingInstructions(XmlFields::returnArrayValue($hash_in,'processingInstructions'))), @@ -71,7 +72,7 @@ public function authorizationRequest($hash_in) ); } - $choice_hash = array(XmlFields::returnArrayValue($hash_out,'card'),XmlFields::returnArrayValue($hash_out,'paypal'),XmlFields::returnArrayValue($hash_out,'token'),XmlFields::returnArrayValue($hash_out,'paypage')); + $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')); $authorizationResponse = LitleOnlineRequest::processRequest($hash_out,$hash_in,'authorization',$choice_hash); return $authorizationResponse; } @@ -91,6 +92,7 @@ public function saleRequest($hash_in) 'paypal'=>XmlFields::payPal(XmlFields::returnArrayValue($hash_in,'paypal')), 'token'=>XmlFields::cardTokenType(XmlFields::returnArrayValue($hash_in,'token')), 'paypage'=>XmlFields::cardPaypageType(XmlFields::returnArrayValue($hash_in,'paypage')), + 'mpos'=>(XmlFields::mposType(XmlFields::returnArrayValue($hash_in,'mpos'))), 'billMeLaterRequest'=>XmlFields::billMeLaterRequest(XmlFields::returnArrayValue($hash_in,'billMeLaterRequest')), 'fraudCheck'=>XmlFields::fraudCheckType(XmlFields::returnArrayValue($hash_in,'fraudCheck')), 'cardholderAuthentication'=>XmlFields::fraudCheckType(XmlFields::returnArrayValue($hash_in,'cardholderAuthentication')), @@ -114,7 +116,7 @@ public function saleRequest($hash_in) 'advancedFraudChecks'=>XmlFields::advancedFraudChecksType(XmlFields::returnArrayValue($hash_in,'advancedFraudChecks')), ); - $choice_hash = array($hash_out['card'],$hash_out['paypal'],$hash_out['token'],$hash_out['paypage']); + $choice_hash = array($hash_out['card'],$hash_out['paypal'],$hash_out['token'],$hash_out['paypage'],$hash_out['mpos']); $choice2_hash= array($hash_out['fraudCheck'],$hash_out['cardholderAuthentication']); $saleResponse = LitleOnlineRequest::processRequest($hash_out,$hash_in,'sale',$choice_hash,$choice2_hash); return $saleResponse; @@ -145,6 +147,7 @@ public function creditRequest($hash_in) 'paypal'=>XmlFields::credit_payPal(XMLFields::returnArrayValue($hash_in, 'paypal')), 'token'=>XmlFields::cardTokenType(XMLFields::returnArrayValue($hash_in, 'token')), 'paypage'=>XmlFields::cardPaypageType(XMLFields::returnArrayValue($hash_in, 'paypage')), + 'mpos'=>(XmlFields::mposType(XmlFields::returnArrayValue($hash_in,'mpos'))), 'customBilling'=>XmlFields::customBilling(XMLFields::returnArrayValue($hash_in, 'customBilling')), 'taxBilling'=>XmlFields::taxBilling(XMLFields::returnArrayValue($hash_in, 'taxBilling')), 'billMeLaterRequest'=>XmlFields::billMeLaterRequest(XMLFields::returnArrayValue($hash_in, 'billMeLaterRequest')), @@ -156,7 +159,7 @@ public function creditRequest($hash_in) 'actionReason'=>XmlFields::returnArrayValue($hash_in, 'actionReason') ); - $choice_hash = array($hash_out['card'],$hash_out['paypal'],$hash_out['token'],$hash_out['paypage']); + $choice_hash = array($hash_out['card'],$hash_out['paypal'],$hash_out['token'],$hash_out['paypage'],$hash_out['mpos']); $creditResponse = LitleOnlineRequest::processRequest($hash_out,$hash_in,'credit',$choice_hash); return $creditResponse; } @@ -187,6 +190,7 @@ public function forceCaptureRequest($hash_in) 'card'=> XmlFields::cardType(XmlFields::returnArrayValue($hash_in,'card')), 'token'=>XmlFields::cardTokenType(XmlFields::returnArrayValue($hash_in,'token')), 'paypage'=>XmlFields::cardPaypageType(XmlFields::returnArrayValue($hash_in,'paypage')), + 'mpos'=>(XmlFields::mposType(XmlFields::returnArrayValue($hash_in,'mpos'))), 'customBilling'=>XmlFields::customBilling(XmlFields::returnArrayValue($hash_in,'customBilling')), 'taxBilling'=>XmlFields::taxBilling(XmlFields::returnArrayValue($hash_in,'taxBilling')), 'enhancedData'=>XmlFields::enhancedData(XmlFields::returnArrayValue($hash_in,'enhancedData')), @@ -197,7 +201,7 @@ public function forceCaptureRequest($hash_in) 'debtRepayment'=>XmlFields::returnArrayValue($hash_in,'debtRepayment'), ); - $choice_hash = array(XmlFields::returnArrayValue($hash_out,'card'),XmlFields::returnArrayValue($hash_out,'paypal'),XmlFields::returnArrayValue($hash_out,'token'),XmlFields::returnArrayValue($hash_out,'paypage')); + $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')); $forceCaptureResponse = LitleOnlineRequest::processRequest($hash_out,$hash_in,'forceCapture',$choice_hash); return $forceCaptureResponse; } @@ -230,6 +234,7 @@ public function captureGivenAuthRequest($hash_in) 'card'=> XmlFields::cardType(XmlFields::returnArrayValue($hash_in,'card')), 'token'=>XmlFields::cardTokenType(XmlFields::returnArrayValue($hash_in,'token')), 'paypage'=>XmlFields::cardPaypageType(XmlFields::returnArrayValue($hash_in,'paypage')), + 'mpos'=>(XmlFields::mposType(XmlFields::returnArrayValue($hash_in,'mpos'))), 'customBilling'=>XmlFields::customBilling(XmlFields::returnArrayValue($hash_in,'customBilling')), 'taxBilling'=>XmlFields::taxBilling(XmlFields::returnArrayValue($hash_in,'taxBilling')), 'billMeLaterRequest'=>XmlFields::billMeLaterRequest(XmlFields::returnArrayValue($hash_in,'billMeLaterRequest')), @@ -241,7 +246,7 @@ public function captureGivenAuthRequest($hash_in) 'debtRepayment'=>XmlFields::returnArrayValue($hash_in,'debtRepayment') ); - $choice_hash = array($hash_out['card'],$hash_out['token'],$hash_out['paypage']); + $choice_hash = array($hash_out['card'],$hash_out['token'],$hash_out['paypage'],$hash_out['mpos']); $captureGivenAuthResponse = LitleOnlineRequest::processRequest($hash_out,$hash_in,'captureGivenAuth',$choice_hash); return $captureGivenAuthResponse; } diff --git a/lib/XmlFields.php b/lib/XmlFields.php index 6005a501..7164e497 100644 --- a/lib/XmlFields.php +++ b/lib/XmlFields.php @@ -511,4 +511,22 @@ public static function advancedFraudChecksType($hash_in) return $hash_out; } } + + public static function mposType($hash_in) + { + if(isset($hash_in)) + { + $hash_out = array( + "ksn"=>(Checker::requiredField(XmlFields::returnArrayValue($hash_in, "ksn", 1028))), + "formatId"=>(Checker::requiredField(XmlFields::returnArrayValue($hash_in, "formatId", 1028))), + "encryptedTrack"=>(Checker::requiredField(XmlFields::returnArrayValue($hash_in, "encryptedTrack", 1028))), + "track1Status"=>(Checker::requiredField(XmlFields::returnArrayValue($hash_in, "track1Status", 1028))), + "track2Status"=>(Checker::requiredField(XmlFields::returnArrayValue($hash_in, "track2Status", 1028))) + ); + return $hash_out; + } + + + + } } diff --git a/test/unit/test_XmlFields.php b/test/unit/test_XmlFields.php index 007348fc..d35c793e 100644 --- a/test/unit/test_XmlFields.php +++ b/test/unit/test_XmlFields.php @@ -528,6 +528,21 @@ function test_pos_has_optional_catLevel() $this->assertEquals($hash_out["cardholderId"],"REQUIRED"); $this->assertEquals($hash_out["catLevel"],"self service"); } + + function test_mpos_required() + { + $hash_in = array('ksn' => '123', 'formatId' =>'30', 'encryptedTrack' => 'Encrypted Track', 'track1Status' =>'2', 'track2Status' => '1'); + $hash_out = XmlFields::mposType($hash_in); + $this->assertEquals($hash_out["ksn"],"123"); + $this->assertEquals($hash_out["formatId"],"30"); + $this->assertEquals($hash_out["encryptedTrack"],"Encrypted Track"); + $this->assertEquals($hash_out["track1Status"],"2"); + $this->assertEquals($hash_out["track2Status"],"1"); + + + + + } }