[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant-frontends] branch master updated: payed art
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant-frontends] branch master updated: payed articles are kept in a dict, having article name as key and order_id as value |
Date: |
Thu, 22 Jun 2017 15:44:35 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository merchant-frontends.
The following commit(s) were added to refs/heads/master by this push:
new f2d84c5 payed articles are kept in a dict, having article name as key
and order_id as value
f2d84c5 is described below
commit f2d84c51266bdfe848994044da8b338013bde030
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Jun 22 15:44:16 2017 +0200
payed articles are kept in a dict, having article name as key
and order_id as value
---
talerfrontends/blog/blog.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/talerfrontends/blog/blog.py b/talerfrontends/blog/blog.py
index a268995..dedf6c4 100644
--- a/talerfrontends/blog/blog.py
+++ b/talerfrontends/blog/blog.py
@@ -147,7 +147,7 @@ def cc_payment(name):
@app.route("/essay/<name>/data/<data>")
def article(name, data=None):
logger.info("processing %s" % name)
- payed_articles = flask.session.get("payed_articles", [])
+ payed_articles = flask.session.get("payed_articles", {})
if name in payed_articles:
article = articles[name]
if article is None:
@@ -179,10 +179,12 @@ def pay():
return backend_error(r)
proposal_data = r.json()["contract_terms"]
article_name = proposal_data["extra"]["article_name"]
- payed_articles = flask.session["payed_articles"] =
flask.session.get("payed_articles", [])
+ payed_articles = flask.session["payed_articles"] =
flask.session.get("payed_articles", {})
+ if not deposit_permission["order_id"]:
+ logger.error("order_id missing from deposit_permission!")
+ return flask.jsonify(dict(error="internal error: ask for refund!"))
if article_name not in payed_articles:
- payed_articles.append(article_name)
-
+ payed_articles[article_name] = deposit_permission["order_id"]
return flask.jsonify(r.json()), 200
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant-frontends] branch master updated: payed articles are kept in a dict, having article name as key and order_id as value,
gnunet <=