Fix formatting of hashstring.
This commit is contained in:
parent
83ccef5c7d
commit
3b44f33e04
|
@ -84,15 +84,15 @@ class EpayView(TemplateView):
|
||||||
description = str(ticket.user.pk)
|
description = str(ticket.user.pk)
|
||||||
|
|
||||||
hashstring = (
|
hashstring = (
|
||||||
'{merchantnumber}{description}11{amount}DKK'
|
'{merchant_number}{description}11{amount}DKK'
|
||||||
'{order_id}{accept_url}{md5_secret}'
|
'{order_id}{accept_url}{md5_secret}'
|
||||||
).format(
|
).format(
|
||||||
settings.EPAY_MERCHANT_NUMBER,
|
merchant_number=settings.EPAY_MERCHANT_NUMBER,
|
||||||
description,
|
description=description,
|
||||||
str(amount),
|
amount=str(amount),
|
||||||
str(order_id),
|
order_id=str(order_id),
|
||||||
accept_url,
|
accept_url=accept_url,
|
||||||
settings.EPAY_MD5_SECRET,
|
md5_secret=settings.EPAY_MD5_SECRET,
|
||||||
)
|
)
|
||||||
epay_hash = hashlib.md5(hashstring).hexdigest()
|
epay_hash = hashlib.md5(hashstring).hexdigest()
|
||||||
|
|
||||||
|
@ -124,15 +124,15 @@ class EpayCallbackView(View):
|
||||||
)
|
)
|
||||||
|
|
||||||
hashstring = (
|
hashstring = (
|
||||||
'{merchantnumber}{description}11{amount}DKK'
|
'{merchant_number}{description}11{amount}DKK'
|
||||||
'{order_id}{accept_url}{md5_secret}'
|
'{order_id}{accept_url}{md5_secret}'
|
||||||
).format(
|
).format(
|
||||||
query.get('merchantnumber'),
|
merchant_number=query.get('merchantnumber'),
|
||||||
query.get('description'),
|
description=query.get('description'),
|
||||||
query.get('amount'),
|
amount=query.get('amount'),
|
||||||
query.get('order_id'),
|
order_id=query.get('orderid'),
|
||||||
query.get('accept_url'),
|
accept_url=query.get('accepturl'),
|
||||||
settings.EPAY_MD5_SECRET,
|
md5_secret=settings.EPAY_MD5_SECRET,
|
||||||
)
|
)
|
||||||
epay_hash = hashlib.md5(hashstring).hexdigest()
|
epay_hash = hashlib.md5(hashstring).hexdigest()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue