[ADD]:Added Upstream patch for payment_adyen
This commit is contained in:
parent
3ee4085418
commit
cecc73bd42
@ -3,3 +3,4 @@
|
|||||||
|
|
||||||
from . import models
|
from . import models
|
||||||
from . import controllers
|
from . import controllers
|
||||||
|
from flectra.addons.payment.models.payment_acquirer import create_missing_journal_for_acquirers
|
||||||
|
@ -14,4 +14,5 @@
|
|||||||
'data/payment_acquirer_data.xml',
|
'data/payment_acquirer_data.xml',
|
||||||
],
|
],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
|
'post_init_hook': 'create_missing_journal_for_acquirers',
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ from werkzeug import urls
|
|||||||
from flectra import api, fields, models, tools, _
|
from flectra import api, fields, models, tools, _
|
||||||
from flectra.addons.payment.models.payment_acquirer import ValidationError
|
from flectra.addons.payment.models.payment_acquirer import ValidationError
|
||||||
from flectra.addons.payment_adyen.controllers.main import AdyenController
|
from flectra.addons.payment_adyen.controllers.main import AdyenController
|
||||||
|
from flectra.tools.pycompat import to_native
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -192,7 +193,7 @@ class TxAdyen(models.Model):
|
|||||||
shasign_check = tx.acquirer_id._adyen_generate_merchant_sig_sha256('out', data)
|
shasign_check = tx.acquirer_id._adyen_generate_merchant_sig_sha256('out', data)
|
||||||
else:
|
else:
|
||||||
shasign_check = tx.acquirer_id._adyen_generate_merchant_sig('out', data)
|
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)
|
error_msg = _('Adyen: invalid merchantSig, received %s, computed %s') % (data.get('merchantSig'), shasign_check)
|
||||||
_logger.warning(error_msg)
|
_logger.warning(error_msg)
|
||||||
raise ValidationError(error_msg)
|
raise ValidationError(error_msg)
|
||||||
|
Loading…
Reference in New Issue
Block a user