Skip to content

Commit

Permalink
IDTech support, commit #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Theuninck committed Nov 8, 2012
1 parent e3c6868 commit d48aa4f
Show file tree
Hide file tree
Showing 10 changed files with 1,084 additions and 50 deletions.
2 changes: 1 addition & 1 deletion pos/is4c-nf/cc-modules/BasicCCModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ function soapify($action,$objs,$namespace="",$encode_tags=True){
function desoapify($action,$soaptext){
preg_match("/<$action.*?>(.*?)<\/$action>/s",
$soaptext,$groups);
return $groups[1];
return isset($groups[1]) ? $groups[1] : "";
}

/**
Expand Down
Binary file added pos/is4c-nf/graphics/ccInLit.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pos/is4c-nf/graphics/ccTestLit.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 9 additions & 4 deletions pos/is4c-nf/gui-class-lib/BasicPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ function BasicPage(){
if ($this->preprocess()){
ob_start();
$this->print_page();
while (ob_get_level() > 0)
ob_end_flush();
ob_end_flush();
}
}

Expand Down Expand Up @@ -239,10 +238,16 @@ function betterDate() {
}
if($CORE_LOCAL->get("CCintegrate") == 1 &&
$CORE_LOCAL->get("ccLive") == 1 && $CORE_LOCAL->get("training") == 0){
echo "<img src='{$my_url}graphics/ccIn.gif'>&nbsp;";
if ($CORE_LOCAL->get("CachePanEncBlock")=="")
echo "<img src='{$my_url}graphics/ccIn.gif'>&nbsp;";
else
echo "<img src='{$my_url}graphics/ccInLit.gif'>&nbsp;";
}elseif($CORE_LOCAL->get("CCintegrate") == 1 &&
($CORE_LOCAL->get("training") == 1 || $CORE_LOCAL->get("ccLive") == 0)){
echo "<img src='{$my_url}graphics/ccTest.gif'>&nbsp;";
if ($CORE_LOCAL->get("CachePanEncBlock")=="")
echo "<img src='{$my_url}graphics/ccTest.gif'>&nbsp;";
else
echo "<img src='{$my_url}graphics/ccTestLit.gif'>&nbsp;";
}

echo "<span id=\"timeSpan\" class=\"time\">".$time."</span>\n";
Expand Down
2 changes: 2 additions & 0 deletions pos/is4c-nf/gui-modules/paycardSuccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function preprocess(){
}

PaycardLib::paycard_reset();
UdpComm::udpSend("termReset");
$CORE_LOCAL->set("strRemembered","TO");
$CORE_LOCAL->set("msgrepeat",1);

Expand Down Expand Up @@ -188,6 +189,7 @@ function body_content(){
echo DisplayLib::boxMsg($CORE_LOCAL->get("boxMsg"),"",True);
$CORE_LOCAL->set("msgrepeat",2);
//UdpComm::udpSend('goodBeep');
UdpComm::udpSend('termApproved');
?>
</div>
<?php
Expand Down
9 changes: 8 additions & 1 deletion pos/is4c-nf/gui-modules/paycardboxMsgAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ function preprocess(){
if (is_object($st))
$st->WriteToScale($CORE_LOCAL->get("ccTermOut"));
PaycardLib::paycard_reset();
$CORE_LOCAL->set("CachePanEncBlock","");
$CORE_LOCAL->set("CachePinEncBlock","");
$CORE_LOCAL->set("CacheCardType","");
UdpComm::udpSend("termReset");
$this->change_page($this->page_url."gui-modules/pos2.php");
return False;
}
Expand Down Expand Up @@ -100,7 +104,10 @@ function body_content(){
echo PaycardLib::paycard_msgBox($type,"Invalid Amount",
"Enter a lesser amount","[clear] to cancel");
} else if( $amt > 0) {
echo PaycardLib::paycard_msgBox($type,"Tender ".PaycardLib::paycard_moneyFormat($amt)."?","","[enter] to continue if correct<br>Enter a different amount if incorrect<br>[clear] to cancel");
$msg = "Tender ".PaycardLib::paycard_moneyFormat($amt);
if ($CORE_LOCAL->get("CacheCardType") != "")
$msg .= " as ".$CORE_LOCAL->get("CacheCardType");
echo PaycardLib::paycard_msgBox($type,$msg."?","","[enter] to continue if correct<br>Enter a different amount if incorrect<br>[clear] to cancel");
} else if( $amt < 0) {
echo PaycardLib::paycard_msgBox($type,"Refund ".PaycardLib::paycard_moneyFormat($amt)."?","","[enter] to continue if correct<br>Enter a different amount if incorrect<br>[clear] to cancel");
} else {
Expand Down
3 changes: 1 addition & 2 deletions pos/is4c-nf/gui-modules/pos2.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ function receiptFetch(r_type){
});
}
function inputRetry(str){
$('#reginput').val(str);
submitWrapper();
parseWrapper(str);
}
</script>
<?php
Expand Down
7 changes: 4 additions & 3 deletions pos/is4c-nf/lib/CoreState.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ static public function system_init() {
$CORE_LOCAL->set("ccRemoteServerUp",1);
$CORE_LOCAL->set("search_or_list",0);
$CORE_LOCAL->set("ccTermOut","idle");
$td = SigCapture::term_object();
if (is_object($td))
$td->WriteToScale("reset");
}

/**
Expand Down Expand Up @@ -145,6 +142,10 @@ static public function transReset() {
$CORE_LOCAL->set("warned",0);
$CORE_LOCAL->set("warnBoxType","");
$CORE_LOCAL->set("requestType","");

$CORE_LOCAL->set("CachePanEncBlock","");
$CORE_LOCAL->set("CachePinEncBlock","");
$CORE_LOCAL->set("CacheCardType","");
}

/**
Expand Down
58 changes: 46 additions & 12 deletions pos/is4c-nf/parser-class-lib/parse/SigTermCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,33 @@ class SigTermCommands extends Parser {

function check($str){
global $CORE_LOCAL;
if ($str == "TRESET"){
$CORE_LOCAL->set("ccTermOut","reset");
if ($str == "TERMMANUAL"){
UdpComm::udpSend("termManual");
return True;
}
if ($str == "TSIG"){
$CORE_LOCAL->set("ccTermOut","sig");
elseif ($str == "TERMRESET"){
UdpComm::udpSend("termReset");
return True;
}
elseif ($str == "CCFROMCACHE"){
return True;
}
else if (substr($str,0,9) == "PANCACHE:"){
$CORE_LOCAL->set("CachePanEncBlock",substr($str,9));
return True;
}
else if (substr($str,0,9) == "PINCACHE:"){
$CORE_LOCAL->set("CachePinEncBlock",substr($str,9));
return True;
}
else if ($str == "TERMCLEARALL"){
$CORE_LOCAL->set("CachePanEncBlock","");
$CORE_LOCAL->set("CachePinEncBlock","");
$CORE_LOCAL->set("CacheCardType","");
return True;
}
else if (substr($str,0,5) == "TERM:"){
$CORE_LOCAL->set("CacheCardType",substr($str,5));
return True;
}
return False;
Expand All @@ -39,9 +60,9 @@ function check($str){
function parse($str){
global $CORE_LOCAL;
$ret = $this->default_json();
$ret['udpmsg'] = $CORE_LOCAL->get("ccTermOut");
if ($ret['udpmsg'] == "sig")
$ret['main_frame'] = MiscLib::base_url().'gui-modules/paycardSignature.php';
if ($str == "CCFROMCACHE"){
$ret['retry'] = $CORE_LOCAL->get("CachePanEncBlock");
}
return $ret;
}

Expand All @@ -51,13 +72,26 @@ function doc(){
<th>Input</th><th>Result</th>
</tr>
<tr>
<td>WAKEUP</td>
<td>Try to coax a stuck scale back
into operation</td>
<td>TERMMANUAL</td>
<td>
Send CC terminal to manual entry mode
</td>
</tr>
<tr>
<td>TERMRESET</td>
<td>Reset CC terminal to begin transaction</td>
</tr>
<tr>
<td>CCFROMCACHE</td>
<td>Charge the card cached earlier</td>
</tr>
<tr>
<td>PANCACHE:<encrypted block></td>
<td>Cache an encrypted block on swipe</td>
</tr>
<tr>
<td>WAKEUP2</td>
<td>Different method, same goal</td>
<td>PINCACHE:<encrypted block></td>
<td>Cache an encrypted block on PIN entry</td>
</tr>
</table>";
}
Expand Down
Loading

0 comments on commit d48aa4f

Please sign in to comment.