summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMS <ms@taler.net>2020-07-24 14:31:26 +0200
committerMS <ms@taler.net>2020-07-24 14:31:26 +0200
commit50826ee741b56a53c963778f7cf9a58eec547960 (patch)
tree02dd20b8cf7c1385857f9efc33d185d543ee0147
parent6d7517078ba93c865557031f73eca41872df5656 (diff)
downloadtaler-merchant-demos-50826ee741b56a53c963778f7cf9a58eec547960.tar.gz
taler-merchant-demos-50826ee741b56a53c963778f7cf9a58eec547960.tar.bz2
taler-merchant-demos-50826ee741b56a53c963778f7cf9a58eec547960.zip
Adapt survey site.
-rw-r--r--talermerchantdemos/blog/blog.py3
-rw-r--r--talermerchantdemos/survey/survey.py19
-rw-r--r--talermerchantdemos/survey/templates/index.html2
3 files changed, 5 insertions, 19 deletions
diff --git a/talermerchantdemos/blog/blog.py b/talermerchantdemos/blog/blog.py
index f27d777..0aa7987 100644
--- a/talermerchantdemos/blog/blog.py
+++ b/talermerchantdemos/blog/blog.py
@@ -43,9 +43,8 @@ TC = TalerConfig.from_env()
BACKEND_BASE_URL = TC["frontends"]["backend"].value_string(required=True)
CURRENCY = TC["taler"]["currency"].value_string(required=True)
APIKEY = TC["frontends"]["backend_apikey"].value_string(required=True)
-INSTANCE = "blog"
ARTICLE_AMOUNT = CURRENCY + ":0.5"
-BACKEND_URL = urljoin(BACKEND_BASE_URL, f"instances/{INSTANCE}/")
+BACKEND_URL = urljoin(BACKEND_BASE_URL, "instances/blog/")
app.config.from_object(__name__)
diff --git a/talermerchantdemos/survey/survey.py b/talermerchantdemos/survey/survey.py
index 52e4ede..15cb08c 100644
--- a/talermerchantdemos/survey/survey.py
+++ b/talermerchantdemos/survey/survey.py
@@ -40,8 +40,7 @@ CURRENCY = TC["taler"]["currency"].value_string(required=True)
APIKEY = TC["frontends"]["backend_apikey"].value_string(required=True)
app.config.from_object(__name__)
LOGGER = logging.getLogger(__name__)
-INSTANCED_URL = urljoin(BACKEND_URL, "/survey")
-
+INSTANCED_URL = urljoin(BACKEND_URL, f"instances/survey")
##
# Make the environment available into templates.
@@ -92,18 +91,6 @@ def favicon():
mimetype="image/vnd.microsoft.ico"
)
-
-##
-# Give information about the tip reserve status.
-#
-# @return the backend response to a /tip-query request,
-# in a prettified format.
-@app.route("/survey-stats", methods=["GET"])
-def survey_stats():
- stats = backend_get(INSTANCED_URL, "tip-query", params=dict())
- return flask.render_template("templates/survey_stats.html", stats=stats)
-
-
def get_qrcode_svg(data):
factory = qrcode.image.svg.SvgImage
img = qrcode.make(data, image_factory=factory)
@@ -133,8 +120,8 @@ def submit_survey():
next_url=os.environ.get("TALER_ENV_URL_INTRO", "https://taler.net/"),
justification="Payment methods survey"
)
- backend_resp = backend_post(INSTANCED_URL, "tip-authorize", tip_spec)
- taler_tip_uri = backend_resp.get("taler_tip_uri")
+ 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(
diff --git a/talermerchantdemos/survey/templates/index.html b/talermerchantdemos/survey/templates/index.html
index e58e669..f40c235 100644
--- a/talermerchantdemos/survey/templates/index.html
+++ b/talermerchantdemos/survey/templates/index.html
@@ -4,7 +4,7 @@
<div>
<p>
In this page, you can participate in our survey about payment systems
- and get a nice tip - via your Taler wallet - from this shop! <a href={{ url_for('survey_stats') }}>(survey stats)</a>
+ and get a nice tip - via your Taler wallet - from this shop!
</p>
</div>
<div>