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: using more relative


From: gnunet
Subject: [taler-taler-merchant-demos] branch master updated: using more relative times
Date: Thu, 10 Sep 2020 18:09:48 +0200

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

ms pushed a commit to branch master
in repository taler-merchant-demos.

The following commit(s) were added to refs/heads/master by this push:
     new d530292  using more relative times
d530292 is described below

commit d530292d4755ff35e55ebde4069d21035b04c327
Author: MS <ms@taler.net>
AuthorDate: Thu Sep 10 18:09:30 2020 +0200

    using more relative times
---
 talermerchantdemos/blog/blog.py | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/talermerchantdemos/blog/blog.py b/talermerchantdemos/blog/blog.py
index 1d1a332..85f3cfe 100644
--- a/talermerchantdemos/blog/blog.py
+++ b/talermerchantdemos/blog/blog.py
@@ -142,10 +142,10 @@ def confirm_refund(order_id):
         )
     article_name = pay_status["contract_terms"]["extra"]["article_name"]
 
-    ## FIXME: here goes #refund-checks.
-    """
-    if not refunded and < deadline, allow statement below.
-    """
+    if not refundable(pay_status):
+        return flask.render_template(
+            "templates/error.html", message="Item not refundable (anymore)"
+        )
     return flask.render_template(
         "templates/confirm_refund.html", article_name=article_name, 
order_id=order_id
     )
@@ -180,7 +180,7 @@ def refund(order_id):
     if not refundable(pay_status):
         err_abort(
             403, message="Item not refundable (anymore)", json=pay_status
-        ) 
+        )
     refund_spec = dict(reason="Demo reimbursement", refund=ARTICLE_AMOUNT)
     resp = backend_post(BACKEND_URL, f"private/orders/{order_id}/refund", 
refund_spec)
     return flask.redirect(pay_status["order_status_url"])
@@ -259,11 +259,12 @@ def article(article_name, data=None):
             extra=dict(article_name=article_name),
             fulfillment_url=flask.request.base_url,
             summary="Essay: " + article_name.replace("_", " "),
-            # 10 minutes time for a refund
-            refund_deadline=dict(t_ms=1000 * int(time.time() + 10 * 30)),
-            wire_transfer_deadline=dict(t_ms=1000 * int(time.time() + 15 * 
30)),
+            wire_transfer_deadline=dict(t_ms=1000 * int(time.time() + 150))
+        )
+        order_resp = backend_post(
+            BACKEND_URL, "private/orders",
+            dict(order=order, refund_deadline=dict(d_ms=1000 * 120))
         )
-        order_resp = backend_post(BACKEND_URL, "private/orders", 
dict(order=order))
         order_id = order_resp["order_id"]
 
     # Ask the backend for the status of the payment

-- 
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]