From ea133b7bde3ac606865e27ef2e8eb9164e1e3be2 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 5 Dec 2019 22:38:20 +0100 Subject: adaptations for Wau Holland --- ChangeLog | 3 ++ donations.conf | 6 ++- talerdonations/donations/donations.py | 50 +++--------------- talerdonations/donations/templates/base.html | 26 ++-------- talerdonations/donations/templates/checkout.html | 59 ---------------------- talerdonations/donations/templates/index.html | 44 ++++++++-------- talerdonations/donations/templates/javascript.html | 31 ------------ .../templates/provider-not-supported.html | 6 --- .../donations/templates/request_payment.html | 2 +- 9 files changed, 38 insertions(+), 189 deletions(-) delete mode 100644 talerdonations/donations/templates/checkout.html delete mode 100644 talerdonations/donations/templates/javascript.html delete mode 100644 talerdonations/donations/templates/provider-not-supported.html 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 " +# 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 @@ -175,45 +175,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 @@ - - - - - JavaScript disclaimer. - - -

This site does not use JavaScript.

- - - - - - 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 %} -

Payment Provider Not Supported

-

Unfortunately the selected payment provider is not supported in this demo. Please go back and select "Taler".

-{% 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 @@

- 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:

{{ qrcode_svg | safe }} -- cgit v1.2.3