From 144f227dfc377ab99bc6c2d36edcad4741f651b9 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 8 Feb 2019 13:17:46 +0100 Subject: [PATCH 2/4] eopayment: transaction_id must always be equals to refdet (#30485) As only refdet is returned by TIPI we can't generate transaction_id that differs from it. --- eopayment/tipi.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/eopayment/tipi.py b/eopayment/tipi.py index 015e939..07fa089 100644 --- a/eopayment/tipi.py +++ b/eopayment/tipi.py @@ -118,9 +118,7 @@ class Payment(PaymentCommon): objet = orderid + (' ' + objet) if objet else '' if not refdet: refdet = self._generate_refdet() - transaction_id = refdet - else: - transaction_id = '%s_%s' % (refdet, random.randint(1, 1000000000)) + transaction_id = refdet # check objet or fix objet if objet is not None: try: @@ -163,14 +161,9 @@ class Payment(PaymentCommon): raise ResponseError('missing refdet or resultrans') for key, value in fields.items(): fields[key] = value[0] - refdet = fields.get('refdet') - if refdet is None: + transaction_id = fields.get('refdet') + if transaction_id is None: raise ResponseError('refdet is missing') - if 'objet' in fields: - iso_now = fields['objet'] - else: - iso_now = isonow() - transaction_id = '%s_%s' % (iso_now, refdet) result = fields.get('resultrans') if result == 'P': -- 2.20.1