From 03bf693258b5d64e91abee77310e70e9804b775b Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Thu, 19 Nov 2015 16:50:40 +0100 Subject: Fullfillment page detects whether the user comes from a purchase or not --- src/frontend/fullfillment.html | 12 ---------- src/frontend/fullfillment.php | 50 ++++++++++++++++++++++++++++++++++++++++++ src/frontend/pay.php | 12 +++------- 3 files changed, 53 insertions(+), 21 deletions(-) delete mode 100644 src/frontend/fullfillment.html create mode 100644 src/frontend/fullfillment.php diff --git a/src/frontend/fullfillment.html b/src/frontend/fullfillment.html deleted file mode 100644 index 2053f717..00000000 --- a/src/frontend/fullfillment.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - Taler's "Demo" Shop - - - -

Congratulations, your purchase has succeeded! Go to -our homepage, or visit taler.net. -

- - diff --git a/src/frontend/fullfillment.php b/src/frontend/fullfillment.php new file mode 100644 index 00000000..ced9a183 --- /dev/null +++ b/src/frontend/fullfillment.php @@ -0,0 +1,50 @@ + + + + Taler's "Demo" Shop + + + + + + +*/ + +$cli_debug = false; +$backend_test = true; + +if ($_GET['cli_debug'] == 'yes') + $cli_debug = true; + +if ($_GET['backend_test'] == 'no') +{ + $cli_debug = true; + $backend_test = false; +} + +session_start(); +$receiver = $_SESSION['receiver']; + +if (! $receiver) + echo "Please buy something before landing here!"; +else + echo "Thanks for donating to " . $receiver; + +?> + + + diff --git a/src/frontend/pay.php b/src/frontend/pay.php index e7e9e274..face8080 100644 --- a/src/frontend/pay.php +++ b/src/frontend/pay.php @@ -92,15 +92,9 @@ if ($status_code != 200) } else { - /*$resp_page = "GNU Taler payment" - . "Payment succeeded! Go to our homepage";*/ - header("Content-Type", "application/json"); - /*$resp_page = "GNU Taler payment" - . "Payment succeeded!";*/ - - $ffill_obj = array ("fullfillment_page" => "http://" . $_SERVER['SERVER_NAME'] . "/fullfillment"); - echo json_encode ($ffill_obj); +http_response_code (301); +header("Location: http://" . $_SERVER["SERVER_NAME"] . "/fullfillment"); +die(); } ?> -- cgit v1.2.3