gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-merchant-demos] branch master updated (8865aeb -> 85b9419)


From: gnunet
Subject: [taler-taler-merchant-demos] branch master updated (8865aeb -> 85b9419)
Date: Thu, 20 Aug 2020 14:12:01 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a change to branch master
in repository taler-merchant-demos.

    from 8865aeb  include order ID in fulfillment URL for donations demo
     new 4260ba3  use the tip_status_url in survey
     new 85b9419  remove unused dependencies

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 setup.py                                          |  2 --
 talermerchantdemos/survey/survey.py               | 26 +----------------
 talermerchantdemos/survey/templates/show_tip.html | 35 -----------------------
 3 files changed, 1 insertion(+), 62 deletions(-)
 delete mode 100644 talermerchantdemos/survey/templates/show_tip.html

diff --git a/setup.py b/setup.py
index 9075450..07bd8a7 100755
--- a/setup.py
+++ b/setup.py
@@ -11,9 +11,7 @@ setup(name='talermerchantdemos',
       install_requires=["Flask>=0.10",
                         "beautifulsoup4",
                         "jsmin",
-                        "lxml",
                         "requests",
-                        "cachelib",
                         "taler-util"],
       package_data={
           '':[
diff --git a/talermerchantdemos/survey/survey.py 
b/talermerchantdemos/survey/survey.py
index fa5edbf..25b97ad 100644
--- a/talermerchantdemos/survey/survey.py
+++ b/talermerchantdemos/survey/survey.py
@@ -24,9 +24,6 @@ import logging
 from urllib.parse import urljoin
 import flask
 import traceback
-import qrcode
-import qrcode.image.svg
-import lxml.etree
 from taler.util.talerconfig import TalerConfig
 from ..httpcommon import backend_get, backend_post
 
@@ -91,11 +88,6 @@ def favicon():
         mimetype="image/vnd.microsoft.ico"
     )
 
-def get_qrcode_svg(data):
-    factory = qrcode.image.svg.SvgImage
-    img = qrcode.make(data, image_factory=factory)
-    return lxml.etree.tostring(img.get_image()).decode("utf-8")
-
 ##
 # Return a error response to the client.
 #
@@ -121,23 +113,7 @@ def submit_survey():
         justification="Payment methods survey"
     )
     backend_resp = backend_post(INSTANCED_URL, "private/tips", tip_spec)
-    taler_tip_uri = backend_resp.get("tip_redirect_url")
-    if taler_tip_uri:
-        qrcode_svg = get_qrcode_svg(taler_tip_uri)
-        content = flask.render_template(
-            "templates/show_tip.html",
-            qrcode_svg=qrcode_svg,
-            taler_tip_uri=taler_tip_uri,
-        )
-        headers = {"Taler": taler_tip_uri}
-        return flask.Response(content, status=402, headers=headers)
-
-    return err_abort(
-        500,
-        message="Tipping failed, unexpected backend response",
-        json=backend_resp
-    )
-
+    return flask.redirect(backend_resp["tip_status_url"])
 
 ##
 # Serve the main index page.
diff --git a/talermerchantdemos/survey/templates/show_tip.html 
b/talermerchantdemos/survey/templates/show_tip.html
deleted file mode 100644
index 1c6317a..0000000
--- a/talermerchantdemos/survey/templates/show_tip.html
+++ /dev/null
@@ -1,35 +0,0 @@
-{% extends "templates/base.html" %}
-
-
-{% block meta %}
-<noscript>
-  <meta http-equiv="refresh" content="1">
-</noscript>
-{% endblock meta %}
-
-{% block main %}
-
-<h1>Tip Offered</h1>
-
-<div class="taler-installed-hide">
-  <p>
-  Looks like your browser doesn't support GNU Taler payments.  You can try
-  installing a <a href="https://taler.net/en/wallet.html";>wallet browser 
extension</a>.
-  </p>
-</div>
-
-<div>
-
-  <p>
-  You can use this QR code to receive a tip with your mobile wallet:
-  </p>
-
-  {{ qrcode_svg | safe }}
-
-  <p>
-  Click <a href="{{ taler_tip_uri }}">this link</a> to open your system's 
Taler wallet if it exists.
-  </p>
-
-</div>
-
-{% endblock main %}

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]