From 43c0ce5882c9b908d8c462ac15c0f762368b2b51 Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Tue, 11 Apr 2017 08:33:52 +0200 Subject: [PATCH] encode 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 3aef9faa..dba32ba1 100644 --- a/src/shop/epay.py +++ b/src/shop/epay.py @@ -24,6 +24,6 @@ def validate_epay_callback(query): for key, value in query.items(): if key != 'hash': hashstring += value - hash = hashlib.md5(hashstring + settings.EPAY_MD5_SECRET).hexdigest() + hash = hashlib.md5((hashstring + settings.EPAY_MD5_SECRET).encode('utf-8')).hexdigest() return hash == query['hash']