diff --git a/addons/payment_authorize/models/payment.py b/addons/payment_authorize/models/payment.py
index dcd17f0f5d6..c414625397f 100644
--- a/addons/payment_authorize/models/payment.py
+++ b/addons/payment_authorize/models/payment.py
@@ -171,14 +171,14 @@ class TxAuthorize(models.Model):
def _authorize_form_get_tx_from_data(self, data):
""" Given a data dict coming from authorize, verify it and find the related
transaction record. """
- reference, trans_id, fingerprint = data.get('x_invoice_num'), data.get('x_trans_id'), data.get('x_SHA2_Hash') or data.get('x_MD5_Hash')
+ reference, description, trans_id, fingerprint = data.get('x_invoice_num'), data.get('x_description'), data.get('x_trans_id'), data.get('x_SHA2_Hash') or data.get('x_MD5_Hash')
if not reference or not trans_id or not fingerprint:
error_msg = _('Authorize: received data with missing reference (%s) or trans_id (%s) or fingerprint (%s)') % (reference, trans_id, fingerprint)
_logger.info(error_msg)
raise ValidationError(error_msg)
- tx = self.search([('reference', '=', reference)])
+ tx = self.search(['|', ('reference', '=', reference), ('reference', '=', description)])
if not tx or len(tx) > 1:
- error_msg = 'Authorize: received data for reference %s' % (reference)
+ error_msg = 'Authorize: received data for x_invoice_num %s and x_description %s' % (reference, description)
if not tx:
error_msg += '; no order found'
else:
diff --git a/addons/payment_authorize/views/payment_authorize_templates.xml b/addons/payment_authorize/views/payment_authorize_templates.xml
index 66f63bcb18c..e1bad342130 100644
--- a/addons/payment_authorize/views/payment_authorize_templates.xml
+++ b/addons/payment_authorize/views/payment_authorize_templates.xml
@@ -19,6 +19,7 @@
+