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: support the re-purch


From: gnunet
Subject: [taler-taler-merchant-demos] branch master updated: support the re-purchase detection mechanism
Date: Mon, 07 Sep 2020 08:13:53 +0200

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

dold 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 a8d2664  support the re-purchase detection mechanism
a8d2664 is described below

commit a8d266404efe9ea9ce61ff2ee537489e6d5bae3a
Author: Florian Dold <florian.dold@gmail.com>
AuthorDate: Mon Sep 7 11:43:43 2020 +0530

    support the re-purchase detection mechanism
---
 talermerchantdemos/blog/blog.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/talermerchantdemos/blog/blog.py b/talermerchantdemos/blog/blog.py
index c54a8d6..e8b31b2 100644
--- a/talermerchantdemos/blog/blog.py
+++ b/talermerchantdemos/blog/blog.py
@@ -245,8 +245,16 @@ def article(article_name, data=None):
                 article_name=article_name,
                 order_id=order_id,
             )
-        else:
-            return render_article(article_name, data, order_id)
+        return render_article(article_name, data, order_id)
+
+    # Check if the customer came on this page via the
+    # re-purchase detection mechanism
+    ai = pay_status.get("already_paid_order_id")
+    au = pay_status.get("already_paid_fulfillment_url")
+    if ai is not None and au is not None:
+        response = flask.redirect(au)
+        response.set_cookie("order_id", ai, path=f"/essay/{article_name}")
+        return response
 
     # Redirect the browser to a page where the wallet can
     # run the payment protocol.

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