summaryrefslogtreecommitdiff
path: root/examples/shop
diff options
context:
space:
mode:
Diffstat (limited to 'examples/shop')
-rw-r--r--examples/shop/Makefile.am12
-rw-r--r--examples/shop/README47
-rw-r--r--examples/shop/checkout.php183
-rw-r--r--examples/shop/config.php20
-rw-r--r--examples/shop/fulfillment.php134
-rw-r--r--examples/shop/generate_taler_contract.php92
-rw-r--r--examples/shop/index.php139
-rw-r--r--examples/shop/pay.php101
-rw-r--r--examples/shop/style.css143
m---------examples/shop/web-common0
10 files changed, 0 insertions, 871 deletions
diff --git a/examples/shop/Makefile.am b/examples/shop/Makefile.am
deleted file mode 100644
index e005bec1..00000000
--- a/examples/shop/Makefile.am
+++ /dev/null
@@ -1,12 +0,0 @@
-# This Makefile.am is in the public domain
-SUBDIRS = web-common .
-
-EXTRA_DIST = \
- checkout.php \
- config.php \
- fulfillment.php \
- generate_taler_contract.php \
- index.php \
- pay.php \
- README \
- style.css
diff --git a/examples/shop/README b/examples/shop/README
deleted file mode 100644
index 80d9d6bf..00000000
--- a/examples/shop/README
+++ /dev/null
@@ -1,47 +0,0 @@
-INSTALL
-=======
-
-This guide is for running the 'shop' example, which require PHP and is
-served via nginx.
-
-Assuming that your system has a working PHP, the following
-pecl packages are needed (the preferred way to install them
-is with the pecl package manager, and not via your distribution's):
-
-pecl_http
-propro
-raphf
-
-As for the versioning, our working setup is using:
-
-PHP 5.6
-pecl_http 2.4.3 stable
-propro 1.0.0 stable
-raphf 1.1.0 stable
-
-You can now refer to the nginx configuration examples (nginx_example.conf)
-in this directory
-
-FILES
-=====
-
-This directory contains the files implementing the frontend of the new merchant architecture.
-
-Only tested on nginx. To run the website, it suffices to have all the .php and .html files
-in the same directory, and having PHP (with the extension 'pecl_http' enabled) enabled.
-
-File |What implements
---------------------------------
-o index.html | The homepage. Here it is possible to decide how much donate
- to whom you would like.
-
-o fake_wire_transfer.php | PHP script that takes the wire transfer request and passes it on
- | to the /admin/add/incoming API of the demo-exchange.
-
-o checkout.php | The "payment selection" that is the form
- that allows the user to choose the payment method he wishes to use.
- It also implements the request of certificate and trigger the certificate
- viewer in the extension when it arrives in the customer's machine.
-
-o pay.php | Actual receiving of money, plus it gives back a "fullfillment" page
- that informs the user of his well ended deal.
diff --git a/examples/shop/checkout.php b/examples/shop/checkout.php
deleted file mode 100644
index 4daa1d89..00000000
--- a/examples/shop/checkout.php
+++ /dev/null
@@ -1,183 +0,0 @@
-<!DOCTYPE html>
-<!--
- This file is aprt of GNU TALER
- Copyright (C) 2014,2015, 2016 INRIA
-
- TALER 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 3 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 3 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.
-
--->
-<html>
-<head>
- <title>Toy Store - Payment method - Taler Demo</title>
- <link rel="stylesheet" type="text/css" href="web-common/style.css">
- <script type="application/javascript" src="web-common/taler-presence.js"></script>
-</head>
-<body>
-
-<?php
- // get the donation information from form
- $donation_receiver = $_POST['donation_receiver'];
- $donation_amount = $_POST['donation_amount'];
- $donation_currency = $_POST['donation_currency'];
-
- // get frational part
- list ($donation_value, $donation_fraction) = explode (".", $donation_amount, 2);
- // create PHP session and store donation information in session
- $donation_fraction = (float) ("0." . $donation_fraction);
- session_start();
- $_SESSION['receiver'] = $donation_receiver;
- $_SESSION['amount_value'] = (int) $donation_amount;
- $_SESSION['amount_fraction'] = (int) ($donation_fraction * 1000000);
- $_SESSION['currency'] = $donation_currency;
-?>
-
- <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>
- <!--#include virtual="web-common/dropdown-navbar.html" -->
- <h1 class="nav">Toy Store - Select payment method</h1>
- </header>
-
- <aside class="sidebar" id="left">
- </aside>
-
- <section id="main">
- <article>
- <h1>Select your payment method</h1>
-
- <p>
- This is an example for a "checkout" page of a Web shop.
- On the previous page, you have created the shopping cart
- and decided which product to buy (i.e. which project to
- donate KUDOS to). Now in this page, you are asked to
- select a payment option. As Taler is not yet universally
- used, we expect merchants will offer various payment options.
- </p>
- <p>
- The page also demonstrates how to only enable (or show) the Taler
- option if Taler is actually supported by the browser. For example,
- if you disable the Taler extension now, the Taler payment option
- will be disabled in the page. Naturally, you could also trivially
- hide the Taler option entirely by changing the visibility instead.
- </p>
- <p>
- Note that you MUST select Taler here for the demo to continue,
- as the other payment options are just placeholders and not
- really working in the demonstration. Also, it is of course
- possible to ask the user to make this choice already on the
- previous page (with the shopping cart), we just separated the
- two steps to keep each step as simple as possible.
- </p>
-
- <form name="tform" action="" method="POST">
- <div id="opt-form" align="left"><br>
- <input type="radio" name="payment_system" value="lisa"
- id="lisa-radio-button-id">Lisa</input>
- <br/>
- <input type="radio" name="payment_system" value="ycard">You Card</input>
- <br/>
- <input type="radio" name="payment_system" value="cardme">Card Me</input>
- <br/>
- <input type="radio" name="payment_system" value="taler"
- checked
- id="taler-radio-button-id" class="taler-installed-enable">Taler</input>
- <br/>
- <input type="button" onclick="pay(this.form)" value="Ok"></input>
- </div>
- </form>
-
- </article>
- </section>
-
-<script type="text/javascript">
-
-/* This function is called from "taler_pay" after
- we downloaded the JSON contract from the merchant.
- We now need to pass it to the extension. */
-function handle_contract(contract_wrapper) {
- var cEvent = new CustomEvent('taler-confirm-contract', {
- detail: {
- contract_wrapper: contract_wrapper
- }
- });
- document.dispatchEvent(cEvent);
-};
-
-
-/* Trigger Taler contract generation on the server, and pass the
- contract to the extension once we got it. */
-function taler_pay(form) {
- var contract_request = new XMLHttpRequest();
-
- /* Note that the URL we give here is specific to the Demo-shop
- and not dictated by the protocol: each web shop can
- have its own way of generating and transmitting the
- contract, there just must be a way to get the contract
- and to pass it to the wallet when the user selects 'Pay'. */
- contract_request.open("GET", "generate_taler_contract.php", true);
- contract_request.onload = function (e) {
- if (contract_request.readyState == 4) {
- if (contract_request.status == 200) {
- /* display contract_requestificate (i.e. it sends the JSON string
- to the extension) alert (contract_request.responseText); */
- console.log("response text:", contract_request.responseText);
- var contract_wrapper = JSON.parse(contract_request.responseText);
- if (!contract_wrapper) {
- console.error("response text is invalid JSON");
- return;
- }
- handle_contract(contract_wrapper);
- } else {
- /* There was an error obtaining the contract from the merchant,
- obviously this should not happen. To keep it simple, we just
- alert the user to the error. */
- alert("Failure to download contract from merchant " +
- "(" + contract_request.status + "):\n" +
- contract_request.responseText);
- }
- }
- };
- contract_request.onerror = function (e) {
- /* There was an error obtaining the contract from the merchant,
- obviously this should not happen. To keep it simple, we just
- alert the user to the error. */
- alert("Failure requesting the contract:\n" + contract_request.statusText);
- };
- contract_request.send();
-}
-
-
-/* This function is called when the user presses the
- 'Ok' button. We are now supposed to trigger the
- "correct" payment system logic. For this demo, we
- only handle "taler". */
-function pay(form) {
- var choice = form.elements["payment_system"].value;
- if (choice == "taler") {
- taler_pay(form);
- }
- else {
- alert("You selected '" + choice + "', but we do not support this payment system in the demo.");
- }
-};
-
-</script>
-</body>
-</html>
diff --git a/examples/shop/config.php b/examples/shop/config.php
deleted file mode 100644
index 89b7b0bc..00000000
--- a/examples/shop/config.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-/* This file is in the public domain */
-
-$host = $_SERVER["HTTP_HOST"];
-
-switch ($host) {
-case "shop.demo.taler.net":
- $SHOP_CURRENCY = "KUDOS";
- break;
-case "shop.test.taler.net":
- $SHOP_CURRENCY = "PUDOS";
- break;
-default:
- http_response_code ($status_code);
- echo "<p>Configuration error: No currency for domain $host</p>\n";
- die();
- break;
-}
-
-?>
diff --git a/examples/shop/fulfillment.php b/examples/shop/fulfillment.php
deleted file mode 100644
index fc2dc762..00000000
--- a/examples/shop/fulfillment.php
+++ /dev/null
@@ -1,134 +0,0 @@
-<!DOCTYPE html>
-<!--
- This file is part of GNU TALER.
- Copyright (C) 2014, 2015, 2016 INRIA
-
- 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, see <http://www.gnu.org/licenses/>
--->
-<html lang="en">
-<head>
- <title>Taler's "Demo" Shop</title>
- <link rel="stylesheet" type="text/css" href="web-common/style.css">
- <script type="application/javascript" src="web-common/taler-wallet-lib.js"></script>
- <script type="application/javascript">
- function makeVisible() {
- function cb() {
- document.body.style.display = "";
- }
- document.addEventListener("DOMContentLoaded", cb, false);
- }
- </script>
-</head>
-<body style="display:none;">
- <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>
- <!--#include virtual="web-common/dropdown-navbar.html"-->
- <h1 class="nav">Toy Store - Product Page</h1>
- </header>
-
- <aside class="sidebar" id="left">
- </aside>
-
- <section id="main">
- <article>
-<?php
-
-include '../../copylib/util.php';
-include "../../copylib/merchants.php";
-
-$receiver = get($_GET["receiver"]);
-$now = new DateTime();
-$now->setTimestamp(intval(get($_GET["timestamp"])));
-
-if (empty($receiver)) {
- http_response_code(400);
- echo "<p>Bad request (UUID missing)</p>";
- return;
-}
-
-session_start();
-
-$payments = &pull($_SESSION, 'payments', array());
-$my_payment = &pull($payments, $receiver, array());
-
-// This will keep the query parameters.
-$pay_url = url_rel("pay.php");
-$offering_url = url_rel("index.php", true);
-
-if (array() === $my_payment || true !== get($my_payment["is_payed"], false)) {
- // restore contract
- $contract = generate_contract(array(
- "amount_value" => intval($_GET['aval']),
- "amount_fraction" => intval($_GET['afrac']),
- "currency" => $_GET['acurr'],
- "refund_delta" => 'P3M',
- "transaction_id" => intval($_GET['tid']),
- "description" => "Donation to " . $receiver,
- "product_id" => "unused",
- "correlation_id" => "",
- "merchant_name" => "Kudos Inc.",
- "taxes" => array(),
- "now" => $now,
- "fulfillment_url" => get_full_uri())
- );
-
- $resp = give_to_backend("backend/contract", $contract);
- if ($resp->getResponseCode() != 200){
- echo json_encode(array(
- 'error' => "internal error",
- 'hint' => "failed to regenerate contract",
- 'detail' => $resp->body->toString()
- ), JSON_PRETTY_PRINT);
- return;
- }
-
- $hc = json_decode($resp->body->toString(), true)['H_contract'];
- $my_payment['is_payed'] = false;
- $my_payment['hc'] = $hc;
- echo "<p>you have not payed for this contract: " . $hc . "</p>";
- echo "<p>Asking the wallet to re-execute it ... </p>";
- echo "<script>taler.executePayment('$hc', '$pay_url', '$offering_url');</script>";
- return;
-}
-
-$news = false;
-switch ($receiver) {
- case "Taler":
- $news = "https://taler.net/news";
- break;
- case "GNUnet":
- $news = "https://gnunet.org/";
- break;
- case "Tor":
- $news = "https://www.torproject.org/press/press.html.en";
- break;
-}
-
-$msg = "<p>Thanks for donating to " . $receiver . ".</p>";
-if ($news) {
- $msg .= "<p>Check our latest <a href=\"" . $news . "\">news!</a></p>";
-}
-
-echo $msg;
-
-echo "<script>makeVisible();</script>";
-
-?>
- </article>
- </section>
-</body>
-</html>
diff --git a/examples/shop/generate_taler_contract.php b/examples/shop/generate_taler_contract.php
deleted file mode 100644
index 439ea248..00000000
--- a/examples/shop/generate_taler_contract.php
+++ /dev/null
@@ -1,92 +0,0 @@
-<?php
-/*
- This file is part of GNU TALER.
- Copyright (C) 2014-2016 INRIA
-
- 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/>
- */
-
-include '../../copylib/util.php';
-include "../../copylib/config.php";
-include "../../copylib/merchants.php";
-
-session_start();
-
-if (!isset($_SESSION['receiver']))
-{
- http_response_code(400);
- die();
-}
-
-$receiver = $_SESSION['receiver'];
-$amount_value = intval($_SESSION['amount_value']);
-$amount_fraction = intval($_SESSION['amount_fraction']);
-$currency = $_SESSION['currency'];
-
-// generate a front-end transaction id.
-// In production context, we might want to
-// record this value somewhere together
-// with the rest of the contract data.
-$transaction_id = rand(0, 2<<40);
-
-// Human-readable description of this deal
-$desc = "Donation to " . $receiver;
-
-// Take a timestamp
-$now = new DateTime('now');
-
-// Include all information so we can
-// restore the contract without storing it
-$fulfillment_url = url_rel("fulfillment.php")
- . '?timestamp=' . $now->getTimestamp()
- . '&receiver=' . urlencode($receiver)
- . '&aval=' . urlencode($amount_value)
- . '&afrac=' . urlencode($amount_fraction)
- . '&acurr=' . urlencode($currency)
- . '&tid=' . $transaction_id;
-
-$contract = generate_contract(array(
- "amount_value" => $amount_value,
- "amount_fraction" => $amount_fraction,
- "currency" => $currency,
- "refund_delta" => 'P3M',
- "transaction_id" => $transaction_id,
- "description" => $desc,
- "product_id" => "unused",
- "correlation_id" => "",
- "merchant_name" => "Kudos Inc.",
- "taxes" => array(),
- "now" => $now,
- "fulfillment_url" => $fulfillment_url)
-);
-
-$resp = give_to_backend("backend/contract", $contract);
-
-// Our response code is the same we got from the backend:
-http_response_code($resp->getResponseCode());
-
-// Now generate our body
-if ($resp->getResponseCode() != 200)
-{
- echo json_encode(array(
- 'error' => "internal error",
- 'hint' => "backend indicated error",
- 'detail' => $resp->body->toString()
- ), JSON_PRETTY_PRINT);
-}
-else
-{
- # no state here
- $got_json = json_decode($resp->body->toString(), true);
- echo json_encode ($got_json, JSON_PRETTY_PRINT);
-}
-?>
diff --git a/examples/shop/index.php b/examples/shop/index.php
deleted file mode 100644
index c78f9c66..00000000
--- a/examples/shop/index.php
+++ /dev/null
@@ -1,139 +0,0 @@
-<!DOCTYPE html>
-<!--
- This file is part of GNU TALER.
- Copyright (C) 2014, 2015, 2016 INRIA
-
- 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/>
--->
-<?php
-require_once "../../copylib/config.php";
-session_destroy();
-?>
-<html lang="en">
-<head>
- <title>Taler Donation Demo</title>
- <link rel="stylesheet" type="text/css" href="web-common/style.css">
- <script src="web-common/taler-presence.js" type="text/javascript"></script>
-<script type="text/javascript">
-<?php
-echo "\tvar shop_currency = '$MERCHANT_CURRENCY';\n";
-?>
-
- function addOption(value, label) {
- var s = document.getElementById("taler-donation");
- var e = document.createElement("option");
- e.textContent = label ? label : ("".concat(value, " ", shop_currency));
- e.value = value;
- s.appendChild(e);
- }
-
- function init() {
- var e = document.getElementById("currency-input");
- e.value = shop_currency;
- addOption("0.1");
- addOption("1.0");
- addOption("6.0", "".concat(5, " ", shop_currency));
- addOption("10");
- }
-
- document.addEventListener("DOMContentLoaded", init);
-
-</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>
- <!--#include virtual="web-common/dropdown-navbar.html" -->
- <h1 class="nav">Toy &quot;Store&quot; - Taler Demo</h1>
- </header>
-
- <aside class="sidebar" id="left">
- </aside>
-
- <section id="main">
- <article>
- <h1>Welcome to the Taler Donation "Shop" Demo</h1>
-
- <p>This "toy" website provides you with the ability to
- experience using the
- <a href="https://www.taler.net/">GNU Taler</a>
- payment system without using
- valuable currency. Instead, for the demonstrator we
- will be using a "toy" currency, KUDOS. However, please remember that
- Taler is designed to work with ordinary currencies, such
- as Dollars or Euros, not just toy currencies.
- <br>
- This page, <tt>shop.demo.taler.net</tt> models the behavior of a
- typical Web shop supporting Taler. The other pages of the demo,
- <tt>exchange.demo.taler.net</tt> and
- <tt>bank.demo.taler.net</tt>, correspond to a Taler exchange
- and bank with tight Taler integration respectively. You
- may also enjoy visiting the <tt>blog.demo.taler.net</tt>.
- </p>
- </article>
-
- <div class="taler-installed-hide">
- <h2>Installing the Taler wallet</h2>
- First, you need to install the Taler wallet browser extension.
- Install the wallet
- <span id="install-done" style="visibility: hidden">(done)</span>
- <ul>
- <li>from the app store for <a href="https://chrome.google.com/webstore/detail/gnu-taler-wallet/millncjiddlpgdmkklmhfadpacifaonc">Google
- Chrome and Chromium</a>
- </li>
- <li>By visiting our <a href="/landing">landing page</a>.
- </li>
- </ul>
- Wallets for other browsers will be provided in the near future.
- </div>
-
- <div class="taler-installed-show">
- <p>Please choose a project and the amount of KUDOS you
- wish to donate:</p>
-
- <form name="tform" action="checkout.php" method="POST">
- <div class="participation" id="fake-shop">
- <br>
- <input type="radio" name="donation_receiver" value="Taler" checked="true">GNU Taler</input>
- <br>
- <input type="radio" name="donation_receiver" value="Tor">Tor</input>
- <br>
- <input type="radio" name="donation_receiver" value="GNUnet">GNUnet</input>
- <br>
- <select id="taler-donation" name="donation_amount">
- <!-- options will be added dynamically -->
- </select>
- <input id="currency-input" type="hidden" name="donation_currency"/>
- <input type="submit" name="keyName" value="Donate!"/>
- <br>
- <br>
- </div>
- </form>
- <p>
- (*) To make it a bit more fun, the 5 KUDOS option
- is deliberately implemented with a fault: the merchant will try to
- make you donate 6 KUDOS instead of the 5 KUDOS you got to see. But do
- not worry, you will be given the opportunity to review the
- final offer from the merchant in a window secured
- by the Taler extension. That way, you can spot the
- error before committing to an incorrect contract.
- </p>
- </div>
- </section>
-</body>
-</html>
diff --git a/examples/shop/pay.php b/examples/shop/pay.php
deleted file mode 100644
index f9ed343d..00000000
--- a/examples/shop/pay.php
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-/*
- This file is part of GNU TALER.
- Copyright (C) 2014, 2015, 2016 INRIA
-
- 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/>
-
-*/
-
-include '../../copylib/util.php';
-log_string("getting money");
-// so we won't generate a response for the wrong receiver.
-$receiver = get($_GET["receiver"]);
-if (empty($receiver))
-{
- http_response_code(400);
- echo json_encode(array(
- "error" => "missing parameter",
- "parameter" => "receiver"
- ));
- return;
-}
-
-session_start();
-$payments = &pull($_SESSION, "payments", array());
-
-if (!isset($payments[$receiver]))
-{
- http_response_code(400);
- echo json_encode(array(
- "error" => "no payment session active"
- ));
- return;
-}
-
-$post_body = file_get_contents('php://input');
-$deposit_permission = json_decode ($post_body, true);
-
-// Check if the receiver is actually *mentioned* in the contract
-if ($payments[$receiver]['hc'] != $deposit_permission['H_contract']) {
-
- $json = json_encode(
- array(
- "error" => "ill behaved wallet",
- "status" => 400,
- "detail" => "deposit permission mismatches with reconstructed contract"
- )
- );
- echo $json;
- die();
-}
-
-
-/* Craft the HTTP request, note that the backend
- could be on an entirely different machine if
- desired. */
-
-// Backend is relative to the shop site.
-$url = url_rel("backend/pay");
-
-$req = new http\Client\Request("POST",
- $url,
- array("Content-Type" => "application/json"));
-$req->getBody()->append (json_encode ($deposit_permission));
-
-// Execute the HTTP request to the backend
-$client = new http\Client;
-$client->enqueue($req)->send();
-
-// Fetch the response
-$resp = $client->getResponse();
-$status_code = $resp->getResponseCode();
-
-// Our response code is the same we got from the backend:
-http_response_code($status_code);
-
-// Now generate our body
-if ($status_code != 200)
-{
- $json = json_encode(
- array(
- "error" => "backend error",
- "status" => $status_code,
- "detail" => $resp->body->toString()));
- echo $json;
- die();
-}
-
-$payments = &pull($_SESSION, "payments", array());
-$payments[$receiver]['is_payed'] = true;
-
-?>
diff --git a/examples/shop/style.css b/examples/shop/style.css
deleted file mode 100644
index dd6bc6e8..00000000
--- a/examples/shop/style.css
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2014,2015 INRIA
-
- TALER 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 3 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 3 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.
- */
-body {
- background-color: white;
- margin: 0;
- padding: 0;
- font-family: Verdana, sans;
-}
-
-header {
- width: 100%;
- height: 100px;
- margin: 0;
- padding: 0;
- border-bottom: 1px solid black;
-}
-
-header h1 {
- font-size: 200%;
- margin: 0;
- padding: 0 0 0 120px;
- position: relative;
- top: 50%;
- transform: translateY(-50%);
-}
-
-header #logo {
- float: left;
- width: 100px;
- padding: 0;
- margin: 0;
- text-align: center;
- border-right: 1px solid black;
-}
-
-aside {
- width: 100px;
- float: left;
-}
-
-section#main {
- margin: 0 0 0 100px;
- padding: 20px;
- border-left: 1px solid black;
- height: 100%;
- max-width: 40em;
-}
-
-section#main h1:first-child {
- margin-top: 0;
-}
-
-h1 {
- font-size: 160%;
-}
-
-h2 {
- font-size: 140%;
-}
-
-h3 {
- font-size: 120%;
-}
-
-h4, h5, h6 {
- font-size: 100%;
-}
-
-.loader {
- font-size: 10px;
- margin: 50px auto;
- text-indent: -9999em;
- width: 11em;
- height: 11em;
- border-radius: 50%;
- background: #ffffff;
- background: -moz-linear-gradient(left, #000 10%, rgba(255, 255, 255, 0) 42%);
- background: -webkit-linear-gradient(left, #000 10%, rgba(255, 255, 255, 0) 42%);
- background: -o-linear-gradient(left, #000 10%, rgba(255, 255, 255, 0) 42%);
- background: -ms-linear-gradient(left, #000 10%, rgba(255, 255, 255, 0) 42%);
- position: relative;
- -webkit-animation: load3 1.4s infinite linear;
- animation: load3 1.4s infinite linear;
- -webkit-transform: translateZ(0);
- -ms-transform: translateZ(0);
- transform: translateZ(0);
-}
-
-.loader:after {
- background: #fff;
- width: 75%;
- height: 75%;
- border-radius: 50%;
- content: '';
- margin: auto;
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- right: 0;
-}
-
-@-webkit-keyframes load3 {
- 0% {
- -webkit-transform: rotate(0deg);
- transform: rotate(0deg);
- }
- 100% {
- -webkit-transform: rotate(360deg);
- transform: rotate(360deg);
- }
-}
-
-@keyframes load3 {
- 0% {
- -webkit-transform: rotate(0deg);
- transform: rotate(0deg);
- }
- 100% {
- -webkit-transform: rotate(360deg);
- transform: rotate(360deg);
- }
-}
diff --git a/examples/shop/web-common b/examples/shop/web-common
deleted file mode 160000
-Subproject 80f1e2708dbe4b19349244b611a6167b4b7a98c