merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit fcb5528a6efe508460fc9a29bf136ba8f7a3d6f0
parent fad37ce987eea51f2e9fb0bae9cbbef979c6cc6f
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date:   Tue,  9 Feb 2016 13:25:12 +0100

blog: fulfillment for non taler payments

Diffstat:
Msrc/frontend_blog/essay_cc_pay.php | 24++++++++++++++----------
Msrc/frontend_blog/essay_fulfillment.php | 2++
2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/src/frontend_blog/essay_cc_pay.php b/src/frontend_blog/essay_cc_pay.php @@ -1,18 +1,22 @@ <?php + +include '../frontend_lib/util.php'; +include './blog_lib.php'; + session_start(); if (!$_SESSION['cc_payment']) { echo "No session active"; die(); } -$article = $_GET['article']; -$_SESSION['payment_ok'] = true; -if (!isset($_SESSION['allowed_articles'])) - $_SESSION['allowed_articles'] = array ($article => true); -else $_SESSION['allowed_articles'] = array_merge($_SESSION['allowed_articles'], array ($article => true)); -http_response_code (301); -$url = 'http://' . $_SERVER['HTTP_HOST'] . "/essay_cc_fulfillment.php?article=$article"; -header("Location: " . $url); -echo $url; -die(); +$article = get($_GET['article']); +if (null == $article) +{ + http_response_code(400); + echo "Bad request (no article specified)"; + return; +} +$article_doc = get_article($article); +echo $article_doc->saveHTML(); + ?> diff --git a/src/frontend_blog/essay_fulfillment.php b/src/frontend_blog/essay_fulfillment.php @@ -91,6 +91,8 @@ if (true !== get($my_payment["is_payed"], false)) return; } +// control here = article payed + $article = $my_payment["article"]; $article_doc = get_article($article);