summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-12-05 22:38:20 +0100
committerChristian Grothoff <christian@grothoff.org>2019-12-05 22:38:20 +0100
commitea133b7bde3ac606865e27ef2e8eb9164e1e3be2 (patch)
tree1ed09fcf6fe0947af4597329799c4ed3c1c7d258
parent4cd1758fb8c502cec4502d4c6b79771ff453fdfd (diff)
downloaddonations-ea133b7bde3ac606865e27ef2e8eb9164e1e3be2.tar.gz
donations-ea133b7bde3ac606865e27ef2e8eb9164e1e3be2.tar.bz2
donations-ea133b7bde3ac606865e27ef2e8eb9164e1e3be2.zip
adaptations for Wau Holland
-rw-r--r--ChangeLog3
-rw-r--r--donations.conf6
-rw-r--r--talerdonations/donations/donations.py50
-rw-r--r--talerdonations/donations/templates/base.html26
-rw-r--r--talerdonations/donations/templates/checkout.html59
-rw-r--r--talerdonations/donations/templates/index.html44
-rw-r--r--talerdonations/donations/templates/javascript.html31
-rw-r--r--talerdonations/donations/templates/provider-not-supported.html6
-rw-r--r--talerdonations/donations/templates/request_payment.html2
9 files changed, 38 insertions, 189 deletions
diff --git a/ChangeLog b/ChangeLog
index 596330b..ca9b1ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+Thu 05 Dec 2019 10:09:34 PM CET
+ Created branch for Wau Holland, with simplified logic.
+
Tue Feb 13 10:26:37 CET 2018
Payment logic which is less state-dependant
and more mobile-friendly.
diff --git a/donations.conf b/donations.conf
index 7404b3c..aaed4b4 100644
--- a/donations.conf
+++ b/donations.conf
@@ -1,12 +1,14 @@
[taler]
-currency = TESTKUDOS
+currency = EUR
[frontends]
# Merchant backend to use.
-backend = http://backend.test.taler.net/
+backend = http://backend.euro.taler.net/
# This value will fill: "Authorization: ApiKey <fill here>"
+# NOTE: needs to be changed, but real value shouldn't be in
+# the public Git.
backend_apikey = sandbox
[donations]
diff --git a/talerdonations/donations/donations.py b/talerdonations/donations/donations.py
index c6c03e5..ec2b394 100644
--- a/talerdonations/donations/donations.py
+++ b/talerdonations/donations/donations.py
@@ -1,6 +1,6 @@
##
# This file is part of GNU TALER.
-# Copyright (C) 2014-2016 INRIA
+# Copyright (C) 2014-2016, 2019 Taler Systems SA
#
# 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
@@ -176,45 +176,6 @@ def index():
##
-# Serve the "/javascript" page.
-#
-# @return response object for the /javascript page.
-@app.route("/javascript")
-def javascript_licensing():
- return flask.render_template("templates/javascript.html")
-
-
-##
-# Serve the "/checkout" page. This page lets the
-# user pick the payment method they want to use,
-# and finally confirm the donation.
-#
-# @return response object for the /checkout page.
-@app.route("/checkout", methods=["GET"])
-def checkout():
- amount = expect_parameter("donation_amount")
- donation_receiver = expect_parameter("donation_receiver")
- donation_donor = expect_parameter("donation_donor")
- return flask.render_template(
- "templates/checkout.html",
- donation_amount=amount,
- donation_receiver=donation_receiver,
- donation_donor=donation_donor,
- merchant_currency=CURRENCY
- )
-
-
-##
-# Serve the page advising the user about the impossibility
-# of further processing the payment method they chose.
-#
-# @return response object about the mentioned impossibility.
-@app.route("/provider-not-supported")
-def provider_not_supported():
- return flask.render_template("templates/provider-not-supported.html")
-
-
-##
# POST the donation request to the backend. In particular,
# it uses the "POST /order" API.
#
@@ -227,8 +188,9 @@ def donate():
donation_amount = expect_parameter("donation_amount")
donation_donor = expect_parameter("donation_donor")
payment_system = expect_parameter("payment_system")
- if payment_system != "taler":
- return flask.redirect(flask.url_for("provider_not_supported"))
+ rawa = donation_amount.replace (CURRENCY, "")
+ raws = rawa.strip ('\n ')
+ ramount=CURRENCY+":"+raws
fulfillment_url = flask.url_for(
"fulfillment",
timestamp=str(time.time()),
@@ -236,11 +198,11 @@ def donate():
_external=True
)
order = dict(
- amount=donation_amount,
+ amount=ramount,
extra=dict(
donor=donation_donor,
receiver=donation_receiver,
- amount=donation_amount
+ amount=ramount,
),
fulfillment_url=fulfillment_url,
summary="Donation to {}".format(donation_receiver),
diff --git a/talerdonations/donations/templates/base.html b/talerdonations/donations/templates/base.html
index 86f81a9..3fabc0d 100644
--- a/talerdonations/donations/templates/base.html
+++ b/talerdonations/donations/templates/base.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
-<!--
+<!--
This file is part of GNU TALER.
- Copyright (C) 2014, 2015, 2016 INRIA
+ Copyright (C) 2014, 2015, 2016, 2019 Taler Systems SA
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
@@ -17,38 +17,20 @@
<html data-taler-nojs="true">
<head>
- <title>Taler Donation Demo</title>
+ <title>Wau Holland Welcomes your Donations via GNU Taler</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='web-common/pure.css') }}" />
- <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='web-common/demo.css') }}" />
- <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='web-common/taler-fallback.css') }}" id="taler-presence-stylesheet" />
{% block styles %}{% endblock %}
{% block scripts %}{% endblock %}
</head>
<body>
- <div class="demobar">
- <h1><span class="tt adorn-brackets">Taler Demo</span></h1>
- <h1><span class="it"><a href="{{ env('TALER_ENV_URL_MERCHANT_DONATIONS') }}">Donations</a></span></h1>
- <p>This is the donation page, you can make donations (with an imaginary currency for now) to free software projects.</p>
- <ul>
- <li><a href="{{ env('TALER_ENV_URL_INTRO', '#') }}">Introduction</a></li>
- <li><a href="{{ env('TALER_ENV_URL_BANK', '#') }}">Bank</a></li>
- <li><a href="{{ env('TALER_ENV_URL_MERCHANT_BLOG', '#') }}">Essay Shop</a></li>
- <li><a href="{{ env('TALER_ENV_URL_MERCHANT_DONATIONS', '#') }}">Donations</a></li>
- <li><a href="{{ env('TALER_ENV_URL_MERCHANT_SURVEY', '#') }}">Tipping/Survey</a></li>
- <li><a href="{{ env('TALER_ENV_URL_BACKOFFICE', '#') }}">Back-office</a></li>
- </ul>
- <p>You can learn more about Taler on our main <a href="https://taler.net">website</a>.</p>
- </div>
-
<section id="main" class="content">
{% block main %}
This is the main content of the page.
{% endblock %}
<hr />
<div class="copyright">
- <p>Copyright &copy; 2014&mdash;2017 INRIA</p>
- <a href="/javascript" data-jslicense="1" class="jslicenseinfo">JavaScript license information</a>
+ <p>Copyright &copy; 2014&mdash;2019 Taler Systems SA</p>
</div>
</section>
</body>
diff --git a/talerdonations/donations/templates/checkout.html b/talerdonations/donations/templates/checkout.html
deleted file mode 100644
index 5c3e116..0000000
--- a/talerdonations/donations/templates/checkout.html
+++ /dev/null
@@ -1,59 +0,0 @@
-{% extends "templates/base.html" %}
-
-{% block 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="{{ url_for('donate') }}" method="get">
- <div id="opt-form" align="left"><br>
- <input type="hidden" name="donation_receiver" value="{{ donation_receiver }}">
- <input type="hidden" name="donation_amount" value="{{ donation_amount }}">
- <input type="hidden" name="donation_donor" value="{{ donation_donor }}">
-
- <input type="radio" name="payment_system" value="lisa" id="radio-lisa">
- <label for="radio-lisa">Lisa</input>
- <br/>
-
- <input type="radio" name="payment_system" value="ycard" id="radio-ycard">
- <label for="radio-ycard">You Card</label>
- <br/>
-
- <input type="radio" name="payment_system" value="cardme" id="radio-cardme">
- <label for="radio-cardme">Card Me</label>
- <br/>
-
- <input type="radio" name="payment_system" value="taler" checked id="radio-taler">
- <label for=radio-taler">Taler</label>
- <br/>
-
- <input id="select-payment-method" type="submit" value="Ok"></input>
- </div>
- </form>
-
-</article>
-
-{% endblock main %}
diff --git a/talerdonations/donations/templates/index.html b/talerdonations/donations/templates/index.html
index 68a0cb2..85d5fa6 100644
--- a/talerdonations/donations/templates/index.html
+++ b/talerdonations/donations/templates/index.html
@@ -1,42 +1,38 @@
{% extends "templates/base.html" %}
{% block main %}
-<h1 lang="en">Welcome to the Taler Donation "Shop" Demo</h1>
+<h1 lang="en">Wau Holland Welcomes your Donations via GNU Taler</h1>
-<p>This toy donations website shows the user experience for donations with Taler.
-You are paying with an imaginary currency ({{ merchant_currency }}).
+<p>
+ This website allows you to donate to the Wau Holland Foundation using GNU
+ Taler. This is a limited experiment, as Taler itself is still experimental.
+ Legally speaking, we cannot warrant that your donations will arrive properly
+ at this stage, and no receipts for donations will be issued. You have been
+ warned.
</p>
<div>
- <p>Please select a project, the amount (*) of {{ merchant_currency }} you
- wish to donate, and enter the name that will appear on your receipt:</p>
+ <p>Please select a project, and specify the amount you
+ wish to donate. Optionally, you can specify a name
+ under which the donation will be recorded:</p>
- <form name="tform" action="checkout" method="GET" class="pure-form">
+ <form name="tform" action="{{ url_for('donate') }}" method="GET" class="pure-form">
<div class="participation" id="fake-shop">
<select name="donation_receiver">
- <option value="GNUnet">GNUnet</option>
- <option value="Taler">GNU Taler</option>
- <option value="Tor">Tor</option>
- </select>
- <select id="taler-donation" name="donation_amount">
- <option value="{{ merchant_currency }}:0.1">0.1 {{ merchant_currency }}</option>
- <option value="{{ merchant_currency }}:1">1 {{ merchant_currency }}</option>
- <option value="{{ merchant_currency }}:6">5 {{ merchant_currency }}</option>
- <option value="{{ merchant_currency }}:10">10 {{ merchant_currency }}</option>
+ <option value="antievoting">Anti e-voting campaign</option>
+ <option value="anonymity">Anonymity networks</option>
+ <option value="decentralization">Decentralized communication networks</option>
+ <option value="foi">Freedom of Information</option>
+ <option value="alphabit">Alpha-BIT-isation</option>
+ <option value="selfdetermination">Informational Self-Determination</option>
+ <option value="moralcourage">Moral courage</option>
+ <option value="gnome">GNOME</option>
</select>
+ <input type="text" name="donation_amount" autofocus onfocus="this.value = '1 {{ merchant_currency }}'" />
<input type="text" name="donation_donor" autofocus onfocus="this.value = 'Anonymous Donor'" />
<input type="submit" class="pure-button pure-button-primary" value="Donate!" />
</div>
</form>
- <p>
- (*) To make it a bit more fun, the 5 {{ merchant_currency }} option is
- deliberately implemented with a fault: the merchant will try to make you
- donate 6 {{ merchant_currency }} instead of the 5 {{ merchant_currency }} 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>
{% endblock %}
diff --git a/talerdonations/donations/templates/javascript.html b/talerdonations/donations/templates/javascript.html
deleted file mode 100644
index 436c186..0000000
--- a/talerdonations/donations/templates/javascript.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!-- This file is in the public domain -->
-
-<html>
- <head>
- <title>JavaScript disclaimer.</title>
- </head>
- <body>
- <h3>This site does not use JavaScript.</h3>
- </body>
-</html>
-
-<!-- The following lines are kept as a template for future inclusion of JavaScript files. -->
-
-<!--
- <html>
- <body>
- <table id="jslicense-labels1">
- <tr>
- <td><a href="/static/path/to/example0.js">example0.js</a></td>
- <td><a href="https://www.gnu.org/licenses/lgpl-2.1.html">LGPL</a></td>
- <td><a href="/static/path/to/example0.js.tar.gz">example0.js.tar.gz</a></td>
- </tr>
- <tr>
- <td><a href="/static/path/to/example1.js">example1.js</a></td>
- <td><a href="https://www.gnu.org/licenses/lgpl-2.1.html">LGPL</a></td>
- <td><a href="/static/path/to/example1.js.tar.gz">example1.js.tar.gz</a></td>
- </tr>
- </table>
- </body>
- </html>
--->
diff --git a/talerdonations/donations/templates/provider-not-supported.html b/talerdonations/donations/templates/provider-not-supported.html
deleted file mode 100644
index 88f2000..0000000
--- a/talerdonations/donations/templates/provider-not-supported.html
+++ /dev/null
@@ -1,6 +0,0 @@
-{% extends "templates/base.html" %}
-
-{% block main %}
-<h1>Payment Provider Not Supported</h1>
-<p>Unfortunately the selected payment provider is not supported in this demo. Please go back and select "Taler".</p>
-{% endblock main %}
diff --git a/talerdonations/donations/templates/request_payment.html b/talerdonations/donations/templates/request_payment.html
index 6e050d0..1b24b95 100644
--- a/talerdonations/donations/templates/request_payment.html
+++ b/talerdonations/donations/templates/request_payment.html
@@ -55,7 +55,7 @@
<div>
<p>
- You can use this QR code to pay with your mobile wallet:
+ Alternatively, you can use this QR code to pay with your mobile wallet:
</p>
{{ qrcode_svg | safe }}