ctDecrypt($Data, $Len, $Password); // prepare notify log $a = ""; $a = split ('&', $plaintext); $info = $myPayGate->ctSplit($a, '='); $TransID = $myPayGate->ctSplit($a, '=', 'TransID'); $Status = $myPayGate->ctSplit($a, '=', 'Status'); $PayID = $myPayGate->ctSplit($a, '=', 'PayID'); $Type = $myPayGate->ctSplit($a, '=', 'Type'); $UserData = $myPayGate->ctSplit($a, '=', 'UserData'); $row .= "\nTransID:\t".$TransID; $row .= "\nStatus:\t\t".$Status; $row .= "\nPayID:\t\t".$PayID; $row .= "\nType:\t\t".$Type; $row .= "\nUserData:\t".$UserData; // check transmitted decrypted status $realstatus = $myPayGate->ctRealstatus($Status); // example: writing into a logfile instead of using a database if(!file_exists($filename)){ $fp=fopen($filename, "w"); fclose($fp); } $fpn=@fopen($filename.".tmp", "w"); if($fpn <= 0){ $realstatus .= "\nerror writing logfile $filename.tmp\n"; } $row .= "\nRealstatus:\t".$realstatus; fputs($fpn, $row); $fp = @fopen($filename, "r"); if($fp <= 0){ $realstatus .= "\nerror reading logfile $filename\n"; } while(!feof($fp)){ $zeile = fgets($fp, 32000); fputs($fpn, $zeile); } fclose($fp); fclose($fpn); unlink($filename); rename($filename.".tmp", $filename); // response echo "ok"; // html output - test only /*if(!(($realstatus == $text['paymentsucessful']) || ($realstatus == $text['paymentfailed']))){ require('./includes/html.inc.php'); } else { echo "$filetitle$realstatus"; } */ ?>