fix epay payment

This commit is contained in:
Thomas Steen Rasmussen 2016-05-16 16:49:52 +02:00
parent f88172cd97
commit 3a80691e2c

View file

@ -235,11 +235,11 @@ class EpayFormView(TemplateView):
template_name = 'epay_form.html' template_name = 'epay_form.html'
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
ticket = Ticket.objects.get(pk=kwargs.get('ticket_id')) order = Order.objects.get(pk=kwargs.get('pk'))
accept_url = ticket.get_absolute_url() accept_url = order.get_absolute_url()
amount = ticket.ticket_type.price * 100 amount = order.total
order_id = str(ticket.pk) order_id = str(order.pk)
description = str(ticket.user.pk) description = "BornHack 2016 order #%s" % order.pk
hashstring = ( hashstring = (
'{merchant_number}{description}11{amount}DKK' '{merchant_number}{description}11{amount}DKK'
@ -248,7 +248,7 @@ class EpayFormView(TemplateView):
merchant_number=settings.EPAY_MERCHANT_NUMBER, merchant_number=settings.EPAY_MERCHANT_NUMBER,
description=description, description=description,
amount=str(amount), amount=str(amount),
order_id=str(order_id), order_id=order_id,
accept_url=accept_url, accept_url=accept_url,
md5_secret=settings.EPAY_MD5_SECRET, md5_secret=settings.EPAY_MD5_SECRET,
) )