From b5f61bfaadbb7107b6753870feb02212be5d0ca1 Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Mon, 8 Jul 2019 14:41:41 +0000 Subject: [PATCH] [FIX] payment_authorize: P3 version of 88de931141 closes odoo/odoo#34667 Signed-off-by: Damien Bouvy (dbo) --- addons/payment_authorize/models/payment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/payment_authorize/models/payment.py b/addons/payment_authorize/models/payment.py index 7c5204b9222..6361a211f16 100644 --- a/addons/payment_authorize/models/payment.py +++ b/addons/payment_authorize/models/payment.py @@ -62,7 +62,8 @@ class PaymentAcquirerAuthorize(models.Model): # The signature key is now '128-character hexadecimal format', while the # transaction key was only 16-character. if len(values['x_trans_key']) == 128: - return hmac.new(values['x_trans_key'].decode("hex").encode('utf-8'), data, hashlib.sha512).hexdigest().upper() + key = bytes.fromhex(values['x_trans_key']) + return hmac.new(key, data, hashlib.sha512).hexdigest().upper() else: return hmac.new(values['x_trans_key'].encode('utf-8'), data, hashlib.md5).hexdigest()