From f934cbf0aa4177f0b0b4527a321658075ba524f3 Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Tue, 17 May 2016 08:13:00 +0200 Subject: [PATCH] convert to int, print a warning if we receive a wrong amount from epay --- shop/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shop/views.py b/shop/views.py index f9889102..6b26f799 100644 --- a/shop/views.py +++ b/shop/views.py @@ -289,7 +289,7 @@ class EpayCallbackView(View): ### epay callback is valid - if the order been paid in full, ### create an EpayPayment object linking the callback to the order - if query['amount'] == order.total * 100: + if int(query['amount']) == order.total * 100: EpayPayment.objects.create( order=order, callback=callback, @@ -298,6 +298,8 @@ class EpayCallbackView(View): ### and mark order as paid order.paid=True order.save() + else: + print "valid epay callback with wrong amount detected" else: return HttpResponse(status=400)