[ADD]:Added Upstream patch for payment_adyen

This commit is contained in:
sheetalPatil 2018-07-09 17:38:19 +05:30
parent 3ee4085418
commit cecc73bd42
3 changed files with 4 additions and 1 deletions

View File

@ -3,3 +3,4 @@
from . import models
from . import controllers
from flectra.addons.payment.models.payment_acquirer import create_missing_journal_for_acquirers

View File

@ -14,4 +14,5 @@
'data/payment_acquirer_data.xml',
],
'installable': True,
'post_init_hook': 'create_missing_journal_for_acquirers',
}

View File

@ -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)