Jump to content

EPDQ Receipt Page


roldahayes

Recommended Posts

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

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

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

<?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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.