Skip to content

Commit

Permalink
commiting all change
Browse files Browse the repository at this point in the history
  • Loading branch information
pshah91 committed Mar 7, 2014
1 parent ee2e76f commit 2383c72
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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

Expand Down
15 changes: 10 additions & 5 deletions lib/LitleOnlineRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'))),
Expand All @@ -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;
}
Expand All @@ -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')),
Expand All @@ -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;
Expand Down Expand Up @@ -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')),
Expand All @@ -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;
}
Expand Down Expand Up @@ -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')),
Expand All @@ -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;
}
Expand Down Expand Up @@ -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')),
Expand All @@ -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;
}
Expand Down
18 changes: 18 additions & 0 deletions lib/XmlFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}



}
}
15 changes: 15 additions & 0 deletions test/unit/test_XmlFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");




}

}

Expand Down

0 comments on commit 2383c72

Please sign in to comment.