From d6f5b7e2e608d5613fe70629011908519cb606ce Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 23 Feb 2018 11:15:46 +0100 Subject: [PATCH] [FIX] payment_ogone: correctly decode 3DS html form --- addons/payment_ogone/models/payment.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/addons/payment_ogone/models/payment.py b/addons/payment_ogone/models/payment.py index 7a2adf37d45..691bc55c56e 100644 --- a/addons/payment_ogone/models/payment.py +++ b/addons/payment_ogone/models/payment.py @@ -15,9 +15,8 @@ from odoo import api, fields, models, _ from odoo.addons.payment.models.payment_acquirer import ValidationError from odoo.addons.payment_ogone.controllers.main import OgoneController from odoo.addons.payment_ogone.data import ogone -from odoo.tools import float_round, DEFAULT_SERVER_DATE_FORMAT -from odoo.tools.float_utils import float_compare, float_repr -from odoo.tools.safe_eval import safe_eval +from odoo.tools import DEFAULT_SERVER_DATE_FORMAT, ustr +from odoo.tools.float_utils import float_compare, float_repr, float_round _logger = logging.getLogger(__name__) @@ -470,7 +469,7 @@ class PaymentTxOgone(models.Model): self.write({ 'state': new_state, 'acquirer_reference': tree.get('PAYID'), - 'html_3ds': base64.b64decode(tree.HTML_ANSWER.decode('ascii')), + 'html_3ds': ustr(base64.b64decode(tree.HTML_ANSWER.text)), }) elif status in self._ogone_wait_tx_status and tries > 0: time.sleep(0.5) @@ -575,4 +574,4 @@ class PaymentToken(models.Model): 'acquirer_ref': alias, 'name': 'XXXXXXXXXXXX%s - %s' % (values['cc_number'][-4:], values['cc_holder_name']) } - return {} \ No newline at end of file + return {}