From 50826ee741b56a53c963778f7cf9a58eec547960 Mon Sep 17 00:00:00 2001 From: MS Date: Fri, 24 Jul 2020 14:31:26 +0200 Subject: Adapt survey site. --- talermerchantdemos/blog/blog.py | 3 +-- talermerchantdemos/survey/survey.py | 19 +++---------------- talermerchantdemos/survey/templates/index.html | 2 +- 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 @@

In this page, you can participate in our survey about payment systems - and get a nice tip - via your Taler wallet - from this shop! (survey stats) + and get a nice tip - via your Taler wallet - from this shop!

-- cgit v1.2.3