From 3a80691e2c1f376fb8f10191ea9a22ae0cb33bcb Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Mon, 16 May 2016 16:49:52 +0200 Subject: [PATCH] fix epay payment --- shop/views.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/shop/views.py b/shop/views.py index ceabaadc..c8ebde8a 100644 --- a/shop/views.py +++ b/shop/views.py @@ -235,11 +235,11 @@ class EpayFormView(TemplateView): template_name = 'epay_form.html' def get_context_data(self, **kwargs): - ticket = Ticket.objects.get(pk=kwargs.get('ticket_id')) - accept_url = ticket.get_absolute_url() - amount = ticket.ticket_type.price * 100 - order_id = str(ticket.pk) - description = str(ticket.user.pk) + order = Order.objects.get(pk=kwargs.get('pk')) + accept_url = order.get_absolute_url() + amount = order.total + order_id = str(order.pk) + description = "BornHack 2016 order #%s" % order.pk hashstring = ( '{merchant_number}{description}11{amount}DKK' @@ -248,7 +248,7 @@ class EpayFormView(TemplateView): merchant_number=settings.EPAY_MERCHANT_NUMBER, description=description, amount=str(amount), - order_id=str(order_id), + order_id=order_id, accept_url=accept_url, md5_secret=settings.EPAY_MD5_SECRET, )