summaryrefslogtreecommitdiff
path: root/talerdonations/donations/donations.py
diff options
context:
space:
mode:
Diffstat (limited to 'talerdonations/donations/donations.py')
-rw-r--r--talerdonations/donations/donations.py50
1 files changed, 6 insertions, 44 deletions
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),