summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2016-02-09 13:32:07 +0100
committerMarcello Stanisci <marcello.stanisci@inria.fr>2016-02-09 13:32:07 +0100
commit3cd7996494b9bdc764d7009f47c3382978f7f896 (patch)
tree40711721f0941b2c6dd615cbf58941ebde36c802
parent785e5813359cc9ddd1709070a448ed26fd11b51c (diff)
downloadmerchant-3cd7996494b9bdc764d7009f47c3382978f7f896.tar.gz
merchant-3cd7996494b9bdc764d7009f47c3382978f7f896.tar.bz2
merchant-3cd7996494b9bdc764d7009f47c3382978f7f896.zip
blog: cleaning
-rw-r--r--src/frontend_blog/cc_payment.php2
-rw-r--r--src/frontend_blog/essay_contract.php2
-rw-r--r--src/frontend_blog/execute.js33
-rw-r--r--src/frontend_blog/execute.php56
-rw-r--r--src/frontend_blog/execute.tsx41
-rw-r--r--src/frontend_blog/teaser.php49
6 files changed, 1 insertions, 182 deletions
diff --git a/src/frontend_blog/cc_payment.php b/src/frontend_blog/cc_payment.php
index ec67ac61..54797feb 100644
--- a/src/frontend_blog/cc_payment.php
+++ b/src/frontend_blog/cc_payment.php
@@ -44,7 +44,7 @@
<input type="radio" name="gender">Female</input><br>
</form>
<?php
- echo "<form method=\"post\" action=\"essay_cc_pay.php?article=$article\"><input type=\"submit\"></input></form>";
+ echo "<form method=\"post\" action=\"essay_cc_pay-fulfillment.php?article=$article\"><input type=\"submit\"></input></form>";
?>
</article>
</section>
diff --git a/src/frontend_blog/essay_contract.php b/src/frontend_blog/essay_contract.php
index e256b0ca..5c6d3b41 100644
--- a/src/frontend_blog/essay_contract.php
+++ b/src/frontend_blog/essay_contract.php
@@ -32,8 +32,6 @@ if (!isset($_GET['article'])){
die();
}
$article = $_GET['article'];
-$_SESSION['article'] = $article;
-// 2 to-do
// send contract
$transaction_id = rand(0, 1001);
diff --git a/src/frontend_blog/execute.js b/src/frontend_blog/execute.js
deleted file mode 100644
index a9045cb5..00000000
--- a/src/frontend_blog/execute.js
+++ /dev/null
@@ -1,33 +0,0 @@
-"use strict";
-// JSX literals are compiled to calls to React.createElement calls.
-let React = {
- createElement: function (tag, props, ...children) {
- let e = document.createElement(tag);
- for (let k in props) {
- e.setAttribute(k, props[k]);
- }
- for (let child of children) {
- if ("string" === typeof child || "number" == typeof child) {
- child = document.createTextNode(child);
- }
- e.appendChild(child);
- }
- return e;
- }
-};
-document.addEventListener("DOMContentLoaded", function (e) {
- var eve = new CustomEvent('taler-execute-payment', { detail: { H_contract: h_contract } });
- document.dispatchEvent(eve);
-});
-function replace(el, r) {
- el.parentNode.replaceChild(r, el);
-}
-document.addEventListener("taler-payment-result", function (e) {
- if (!e.detail.success) {
- alert("Payment failed\n" + JSON.stringify(e.detail));
- return;
- }
- console.log("finished payment");
- let msg = React.createElement("div", null, "Payment successful. View your ", React.createElement("a", {"href": e.detail.fulfillmentUrl}, "product"), ".");
- replace(document.getElementById("loading"), msg);
-});
diff --git a/src/frontend_blog/execute.php b/src/frontend_blog/execute.php
deleted file mode 100644
index 33021fd3..00000000
--- a/src/frontend_blog/execute.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <title>Toy Store - Taler Demo</title>
- <link rel="stylesheet" type="text/css" href="style.css">
- <script> /* @licstart The following is the entire license notice for the
- JavaScript code in this page.
-
- Copyright (C) 2015 GNUnet e.V.
-
- The JavaScript code in this page is free software: you can
- redistribute it and/or modify it under the terms of the GNU
- Lesser General Public License (GNU LGPL) as published by the Free Software
- Foundation, either version 2.1 of the License, or (at your option)
- any later version. The code is distributed WITHOUT ANY WARRANTY;
- without even the implied warranty of MERCHANTABILITY or FITNESS
- FOR A PARTICULAR PURPOSE. See the GNU LGPL for more details.
-
- As additional permission under GNU LGPL version 2.1 section 7, you
- may distribute non-source (e.g., minimized or compacted) forms of
- that code without the copy of the GNU LGPL normally required by
- section 4, provided you include this license notice and a URL
- through which recipients can access the Corresponding Source.
-
- @licend The above is the entire license notice
- for the JavaScript code in this page.
- */
- </script>
- <script type="text/javascript">
-<?php
-session_start();
-echo "var h_contract=\"$_SESSION[H_contract]\";\n";
-?>
- </script>
- <script type="text/javascript" src="execute.js"></script>
-</head>
-
-<body>
- <header>
- <div id="logo">
- <svg height="100" width="100">
- <circle cx="50" cy="50" r="40" stroke="darkcyan" stroke-width="6" fill="white" />
- <text x="19" y="82" font-family="Verdana" font-size="90" fill="darkcyan">S</text>
- </svg>
- </div>
- <h1>Toy Store - Taler Demo</h1>
- </header>
-
- <aside class="sidebar" id="left">
- </aside>
-
- <section id="main">
- <h1>Executing Payment ...</h1>
- <div id="loading">Loading...</div>
-</body>
-</html>
diff --git a/src/frontend_blog/execute.tsx b/src/frontend_blog/execute.tsx
deleted file mode 100644
index 67cf8e06..00000000
--- a/src/frontend_blog/execute.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-"use strict";
-
-
-// JSX literals are compiled to calls to React.createElement calls.
-let React = {
- createElement: function(tag, props, ...children) {
- let e = document.createElement(tag);
- for (let k in props) {
- e.setAttribute(k, props[k]);
- }
- for (let child of children) {
- if ("string" === typeof child || "number" == typeof child) {
- child = document.createTextNode(child);
- }
- e.appendChild(child);
- }
- return e;
- }
-};
-
-declare var h_contract: string;
-
-document.addEventListener("DOMContentLoaded", function (e) {
- var eve = new CustomEvent('taler-execute-payment', {detail: {H_contract: h_contract}});
- document.dispatchEvent(eve);
-});
-
-function replace(el, r) {
- el.parentNode.replaceChild(r, el);
-}
-
-document.addEventListener("taler-payment-result", function (e: CustomEvent) {
- if (!e.detail.success) {
- alert("Payment failed\n" + JSON.stringify(e.detail));
- return;
- }
- console.log("finished payment");
- let msg =
- <div>Payment successful. View your <a href={e.detail.fulfillmentUrl}>product</a>.</div>;
- replace(document.getElementById("loading"), msg);
-});
diff --git a/src/frontend_blog/teaser.php b/src/frontend_blog/teaser.php
deleted file mode 100644
index ba802f50..00000000
--- a/src/frontend_blog/teaser.php
+++ /dev/null
@@ -1,49 +0,0 @@
-<html>
-<?php
-/*
- This file is part of GNU TALER.
- Copyright (C) 2014, 2015 GNUnet e.V.
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU Lesser General Public License as published by the Free Software
- Foundation; either version 2.1, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License along with
- TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/>
-*/
-
-/**
- * This file should:
- *
- * 1. fetch the article teaser and attach a 'read more' link to it
- *
- */
-$article = (isset($_GET['article']) ? $_GET['article'] : "No article");
-$content = file_get_contents("articles/$article.html");
-$doc = new DOMDocument();
-$doc->loadHTML($content);
-$teaser = $doc->getElementById("teaser");
-?>
-<head>
- <title>
- <?php echo $article ?>
- </title>
-</head>
-<body onload="signal_taler_wallet_onload();">
-<?php if ($article == "No article")
- echo "Please select some article";
- else {
- session_start();
- $_SESSION['article'] = $article;
- echo $teaser->nodeValue;
- }
-?>
- <br><a href="cc_payment.html" id="read-more">read more</a>
-
-</body>
-
-</html>