summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-08-27 00:28:50 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-08-27 00:28:50 +0200
commit3d6be0c1f78f8771697f2bd474d3cff92daf32a7 (patch)
tree53e811a29507226ac39a5616b4f39c0eca79ade2
parent0f625ecdaaf901c44f48b58ffab80bf6ffd6d4c3 (diff)
downloadblog-3d6be0c1f78f8771697f2bd474d3cff92daf32a7.tar.gz
blog-3d6be0c1f78f8771697f2bd474d3cff92daf32a7.tar.bz2
blog-3d6be0c1f78f8771697f2bd474d3cff92daf32a7.zip
simplify / adapt to backend changes
-rw-r--r--talerblog/blog/blog.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/talerblog/blog/blog.py b/talerblog/blog/blog.py
index 1785f77..90ea11f 100644
--- a/talerblog/blog/blog.py
+++ b/talerblog/blog/blog.py
@@ -233,6 +233,14 @@ def get_qrcode_svg(data):
img = qrcode.make(data, image_factory=factory)
return lxml.etree.tostring(img.get_image()).decode("utf-8")
+
+##
+# This endpoint is used by the payment request page
+# to check if the payment has been completed via the QR code.
+@app.route("/check-status/<order-id>/<session-id>")
+def check_status(order_id, session_id):
+ pass
+
##
# Trigger a article purchase. The logic follows the main steps:
#
@@ -261,7 +269,6 @@ def article(article_name, data=None):
# by just sharing the URL.
session_id = flask.session.get("session_id")
order_id = flask.request.args.get("order_id")
- session_sig = flask.request.args.get("session_sig")
if not session_id:
session_id = flask.session["session_id"] = str(uuid.uuid4())
@@ -287,18 +294,10 @@ def article(article_name, data=None):
order_id=order_id))
##
- # The resource URL uniquely identifies the Web resource that
- # the customer is paying for, and is used to detect that an
- # article has already been puchased when the cookie was lost.
- resource_url = flask.request.base_url
-
- ##
# Prepare data for the upcoming payment check.
pay_params = dict(instance=INSTANCE,
order_id=order_id,
- resource_url=resource_url,
- session_id=session_id,
- session_sig=session_sig)
+ session_id=session_id)
pay_status = backend_get("check-payment", pay_params)