summaryrefslogtreecommitdiff
path: root/talermerchantdemos/blog
diff options
context:
space:
mode:
Diffstat (limited to 'talermerchantdemos/blog')
-rw-r--r--talermerchantdemos/blog/blog.py12
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.