encode before hashing

This commit is contained in:
Thomas Steen Rasmussen 2017-04-11 08:33:52 +02:00
parent 29eda9999f
commit 43c0ce5882

View file

@ -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']