diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-09-07 11:43:43 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-09-07 11:43:43 +0530 |
commit | a8d266404efe9ea9ce61ff2ee537489e6d5bae3a (patch) | |
tree | 806fc12b65b5b11377afec31c7acde4374e7fa63 /talermerchantdemos | |
parent | b0f3d60fec149ffee23872bd0e9290bebdf679e3 (diff) | |
download | taler-merchant-demos-a8d266404efe9ea9ce61ff2ee537489e6d5bae3a.tar.gz taler-merchant-demos-a8d266404efe9ea9ce61ff2ee537489e6d5bae3a.tar.bz2 taler-merchant-demos-a8d266404efe9ea9ce61ff2ee537489e6d5bae3a.zip |
support the re-purchase detection mechanism
Diffstat (limited to 'talermerchantdemos')
-rw-r--r-- | talermerchantdemos/blog/blog.py | 12 |
1 files 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. |