convert to int, print a warning if we receive a wrong amount from epay
This commit is contained in:
parent
ded056baf0
commit
f934cbf0aa
|
@ -289,7 +289,7 @@ class EpayCallbackView(View):
|
||||||
|
|
||||||
### epay callback is valid - if the order been paid in full,
|
### epay callback is valid - if the order been paid in full,
|
||||||
### create an EpayPayment object linking the callback to the order
|
### 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(
|
EpayPayment.objects.create(
|
||||||
order=order,
|
order=order,
|
||||||
callback=callback,
|
callback=callback,
|
||||||
|
@ -298,6 +298,8 @@ class EpayCallbackView(View):
|
||||||
### and mark order as paid
|
### and mark order as paid
|
||||||
order.paid=True
|
order.paid=True
|
||||||
order.save()
|
order.save()
|
||||||
|
else:
|
||||||
|
print "valid epay callback with wrong amount detected"
|
||||||
else:
|
else:
|
||||||
return HttpResponse(status=400)
|
return HttpResponse(status=400)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue