roldahayes Posted July 14, 2009 Share Posted July 14, 2009 Hi, Im hoping someone here can help be with a Barclays EPDQ receipt page...? Basically, the payment all works fine but I'm running into problems writing a page that prints back everything to the customer after they have bought something. I found an example online but cant seem to get it to work. I'm not using a database or anything, so just need it to display, Transaction Status Order Number Amountn payed Date & time and a brief thank you message. The example that I found was; <?php if (!strcmp($_SERVER["REQUEST_METHOD"],"POST")) { $oid=$_POST["oid"]; $transactionstatus=$_POST["transactionstatus"]; $total=$_POST["total"]; $datetime=$_POST["datetime"]; $ecistatus=$_POST["ecistatus"]; echo "<p>Response: Payment recorded</p>"; } } else { header("WWW-Authenticate: Basic realm=\"Payment\""); header("HTTP/1.0 401 Unauthorized"); } ?> Link to comment https://forums.phpfreaks.com/topic/165903-epdq-receipt-page/ Share on other sites More sharing options...
roldahayes Posted July 17, 2009 Author Share Posted July 17, 2009 Still not having any luck with this... Barclays EPDQ have said that I should be using <?php if (!strcmp($_SERVER["REQUEST_METHOD"],"POST")){ #set your logfile directory path here #for example on a unix platform it may be "/www/logs" $log_dir="/var/logs"; #the following date format can be changed to suit your requirements $timestamp=date("d-m-y--H-i-s"); $FILE=fopen("$log_dir/$timestamp-".$_POST["oid"].".txt","a"); fwrite($FILE,"Transaction Status - ".$_POST["transactionstatus"]."\n"); fwrite($FILE,"Total - ".$_POST["total"]."\n"); # fwrite($FILE,"ClientID - ".$_POST["clientid"]."\n"); fwrite($FILE,"Transaction Time Stamp - ".$_POST["datetime"]."\n"); fclose($FILE); } ?> But this just returns a blank page...? Link to comment https://forums.phpfreaks.com/topic/165903-epdq-receipt-page/#findComment-876942 Share on other sites More sharing options...
mattal999 Posted July 17, 2009 Share Posted July 17, 2009 Still not having any luck with this... Barclays EPDQ have said that I should be using <?php if (!strcmp($_SERVER["REQUEST_METHOD"],"POST")){ #set your logfile directory path here #for example on a unix platform it may be "/www/logs" $log_dir="/var/logs"; #the following date format can be changed to suit your requirements $timestamp=date("d-m-y--H-i-s"); $FILE=fopen("$log_dir/$timestamp-".$_POST["oid"].".txt","a"); fwrite($FILE,"Transaction Status - ".$_POST["transactionstatus"]."\n"); fwrite($FILE,"Total - ".$_POST["total"]."\n"); # fwrite($FILE,"ClientID - ".$_POST["clientid"]."\n"); fwrite($FILE,"Transaction Time Stamp - ".$_POST["datetime"]."\n"); fclose($FILE); } ?> But this just returns a blank page...? It will return a blank page because nothing is being echoed. You need to create this directory structure: /var/logs/ Then run the script. You will now see a file starting with a few numbers (unix timestamp). Open it and voila. This script just logs the transactions. If you want to display info, then use echos on each variable. Link to comment https://forums.phpfreaks.com/topic/165903-epdq-receipt-page/#findComment-876943 Share on other sites More sharing options...
roldahayes Posted July 22, 2009 Author Share Posted July 22, 2009 Ok, that makes sense... So how would I write the echo on the varibles? Link to comment https://forums.phpfreaks.com/topic/165903-epdq-receipt-page/#findComment-880196 Share on other sites More sharing options...
mattal999 Posted July 22, 2009 Share Posted July 22, 2009 <?php if (!strcmp($_SERVER["REQUEST_METHOD"],"POST")){ #set your logfile directory path here #for example on a unix platform it may be "/www/logs" $log_dir="/var/logs"; #the following date format can be changed to suit your requirements $timestamp=date("d-m-y--H-i-s"); $FILE=fopen("$log_dir/$timestamp-".$_POST["oid"].".txt","a"); fwrite($FILE,"Transaction Status - ".$_POST["transactionstatus"]."\n"); fwrite($FILE,"Total - ".$_POST["total"]."\n"); # fwrite($FILE,"ClientID - ".$_POST["clientid"]."\n"); fwrite($FILE,"Transaction Time Stamp - ".$_POST["datetime"]."\n"); fclose($FILE); echo "Transaction Status - ".$_POST['transactionstatus']."<br />"; echo "Total - ".$_POST['total']."<br />"; echo "Transaction Time Stamp - ".$_POST['datetime']; } ?> Link to comment https://forums.phpfreaks.com/topic/165903-epdq-receipt-page/#findComment-880207 Share on other sites More sharing options...
roldahayes Posted July 22, 2009 Author Share Posted July 22, 2009 Thanks for the echo help... It still returns a blank page though... does anyone have any thoughts on what I'm doing wrong here? Link to comment https://forums.phpfreaks.com/topic/165903-epdq-receipt-page/#findComment-880215 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.