diff options
Diffstat (limited to 'talerdonations')
-rw-r--r-- | talerdonations/donations/donations.py | 11 | ||||
-rw-r--r-- | talerdonations/donations/templates/fulfillment.html | 3 | ||||
-rw-r--r-- | talerdonations/donations/templates/index.html | 16 |
3 files changed, 14 insertions, 16 deletions
diff --git a/talerdonations/donations/donations.py b/talerdonations/donations/donations.py index dc0657b..5ba4628 100644 --- a/talerdonations/donations/donations.py +++ b/talerdonations/donations/donations.py @@ -40,9 +40,6 @@ CURRENCY = TC["taler"]["currency"].value_string(required=True) app.config.from_object(__name__) -# Will be available in templates -flask.g.currency = CURRENCY - @app.context_processor def utility_processor(): def env(name, default=None): @@ -102,7 +99,7 @@ def internal_error(e): @app.route("/") def index(): - return flask.render_template("templates/index.html") + return flask.render_template("templates/index.html", merchant_currency=CURRENCY) @app.route("/javascript") def javascript_licensing(): @@ -118,7 +115,8 @@ def checkout(): "templates/checkout.html", donation_amount=amount, donation_receiver=donation_receiver, - donation_donor=donation_donor) + donation_donor=donation_donor, + merchant_currency=CURRENCY) @app.route("/provider-not-supported") @@ -167,7 +165,8 @@ def fulfillment(receiver): donation_receiver=extra["receiver"], donation_amount=extra["amount"], donation_donor=extra["donor"], - order_id=order_id) + order_id=order_id, + currency=CURRENCY) # no pay_redirect but article not paid, this should never happen! err_abort(500, message="Internal error, invariant failed", json=pay_status) diff --git a/talerdonations/donations/templates/fulfillment.html b/talerdonations/donations/templates/fulfillment.html index f128693..ac6a48b 100644 --- a/talerdonations/donations/templates/fulfillment.html +++ b/talerdonations/donations/templates/fulfillment.html @@ -4,6 +4,5 @@ <h1>Donation Receipt</h1> <p> Thank you, <strong>{{ donation_donor }}</strong>, for donating <strong>{{ donation_amount }}</strong> to <strong>{{ donation_receiver }}</strong>.</p> -<p>Please keep the order identifier <strong>{{ order_id }}</strong> as a receipt for your donation. You can show other people that you donated -by sharing <a href={{ request.url }}>this link</a> with them.</p> +<p>Please keep the order identifier <strong>{{ order_id }}</strong> as a receipt for your donation.</p> {% endblock main %} diff --git a/talerdonations/donations/templates/index.html b/talerdonations/donations/templates/index.html index a8a05dc..b384362 100644 --- a/talerdonations/donations/templates/index.html +++ b/talerdonations/donations/templates/index.html @@ -4,7 +4,7 @@ <h1 lang="en">Welcome to the Taler Donation "Shop" Demo</h1> <p>This toy donations website shows the user experience for donations with Taler. -You are paying with an imaginary currency ({{ g.merchant_currency }}). +You are paying with an imaginary currency ({{ merchant_currency }}). </p> <div class="taler-installed-hide"> @@ -23,7 +23,7 @@ You are paying with an imaginary currency ({{ g.merchant_currency }}). </div> <div class="taler-installed-show"> - <p>Please select a project, the amount (*) of {{ g.merchant_currency }} you + <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> <form name="tform" action="checkout" method="GET" class="pure-form"> @@ -34,19 +34,19 @@ You are paying with an imaginary currency ({{ g.merchant_currency }}). <option value="Tor">Tor</option> </select> <select id="taler-donation" name="donation_amount"> - <option value="{{ g.merchant_currency }}:0.1">0.1 {{ g.merchant_currency }}</option> - <option value="{{ g.merchant_currency }}:1">1 {{ g.merchant_currency }}</option> - <option value="{{ g.merchant_currency }}:6">5 {{ g.merchant_currency }}</option> - <option value="{{ g.merchant_currency }}:10">10 {{ g.merchant_currency }}</option> + <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> </select> <input type="text" name="donation_donor" 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 {{ g.merchant_currency }} option is + (*) 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 {{ g.merchant_currency }} instead of the 5 {{ g.merchant_currency }} 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 |