From 2550b99b2bebf32f3edb4ffbd8479499e956f829 Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Tue, 11 Apr 2017 08:19:18 +0200 Subject: [PATCH] encode to utf8 before hashing --- src/shop/epay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shop/epay.py b/src/shop/epay.py index 75f56cf1..3aef9faa 100644 --- a/src/shop/epay.py +++ b/src/shop/epay.py @@ -15,7 +15,7 @@ def calculate_epay_hash(order, request): callback_url = order.get_epay_callback_url(request), md5_secret=settings.EPAY_MD5_SECRET, ) - epay_hash = hashlib.md5(hashstring).hexdigest() + epay_hash = hashlib.md5(hashstring.encode('utf-8')).hexdigest() return epay_hash