summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2019-02-08 12:17:46 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2019-02-08 12:20:17 (GMT)
commit144f227dfc377ab99bc6c2d36edcad4741f651b9 (patch)
tree9a8e2fd76b8386ca95748346f6c0061a097a7e73
parent70c1a1b5dbefb0a9e51eb0230e0d4f9394602d3f (diff)
downloadeopayment-144f227dfc377ab99bc6c2d36edcad4741f651b9.zip
eopayment-144f227dfc377ab99bc6c2d36edcad4741f651b9.tar.gz
eopayment-144f227dfc377ab99bc6c2d36edcad4741f651b9.tar.bz2
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.
-rw-r--r--eopayment/tipi.py13
1 files 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':