diff --git a/addons/payment_adyen/__init__.py b/addons/payment_adyen/__init__.py index 81ea421d..96f1329b 100644 --- a/addons/payment_adyen/__init__.py +++ b/addons/payment_adyen/__init__.py @@ -3,3 +3,4 @@ from . import models from . import controllers +from flectra.addons.payment.models.payment_acquirer import create_missing_journal_for_acquirers diff --git a/addons/payment_adyen/__manifest__.py b/addons/payment_adyen/__manifest__.py index ef1e270c..e4ea0455 100644 --- a/addons/payment_adyen/__manifest__.py +++ b/addons/payment_adyen/__manifest__.py @@ -14,4 +14,5 @@ 'data/payment_acquirer_data.xml', ], 'installable': True, + 'post_init_hook': 'create_missing_journal_for_acquirers', } diff --git a/addons/payment_adyen/models/payment.py b/addons/payment_adyen/models/payment.py index e1f2c4de..a247b978 100644 --- a/addons/payment_adyen/models/payment.py +++ b/addons/payment_adyen/models/payment.py @@ -14,6 +14,7 @@ from werkzeug import urls from flectra import api, fields, models, tools, _ from flectra.addons.payment.models.payment_acquirer import ValidationError from flectra.addons.payment_adyen.controllers.main import AdyenController +from flectra.tools.pycompat import to_native _logger = logging.getLogger(__name__) @@ -192,7 +193,7 @@ class TxAdyen(models.Model): shasign_check = tx.acquirer_id._adyen_generate_merchant_sig_sha256('out', data) else: shasign_check = tx.acquirer_id._adyen_generate_merchant_sig('out', data) - if shasign_check != data.get('merchantSig'): + if to_native(shasign_check) != to_native(data.get('merchantSig')): error_msg = _('Adyen: invalid merchantSig, received %s, computed %s') % (data.get('merchantSig'), shasign_check) _logger.warning(error_msg) raise ValidationError(error_msg)