fix epay payment

This commit is contained in:
Thomas Steen Rasmussen 2016-05-16 16:49:52 +02:00
parent f88172cd97
commit 3a80691e2c
1 changed files with 6 additions and 6 deletions

View File

@ -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,
)