summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerghei Mihai <smihai@entrouvert.com>2018-10-03 09:00:40 (GMT)
committerSerghei Mihai <smihai@entrouvert.com>2018-10-12 09:41:34 (GMT)
commit383109078d67ed91a6c84dc3e658dd6cd9bada5b (patch)
tree8499c612aa7e74003050d55339dbf83b6be2dc6c
parentae9bb817f15b398d5ee5bddb8d113f655af6a9f0 (diff)
downloadeopayment-383109078d67ed91a6c84dc3e658dd6cd9bada5b.zip
eopayment-383109078d67ed91a6c84dc3e658dd6cd9bada5b.tar.gz
eopayment-383109078d67ed91a6c84dc3e658dd6cd9bada5b.tar.bz2
paybox: return backend reference and transaction numbers in payment response (#26960)
-rw-r--r--eopayment/paybox.py4
-rw-r--r--tests/test_paybox.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/eopayment/paybox.py b/eopayment/paybox.py
index 3298672..705f1fe 100644
--- a/eopayment/paybox.py
+++ b/eopayment/paybox.py
@@ -234,7 +234,7 @@ class Payment(PaymentCommon):
if orderid:
d['PBX_CMD'] = orderid + ORDERID_TRANSACTION_SEPARATOR + d['PBX_CMD']
d['PBX_PORTEUR'] = force_text(email)
- d['PBX_RETOUR'] = 'montant:M;reference:R;code_autorisation:A;erreur:E;signature:K'
+ d['PBX_RETOUR'] = 'montant:M;reference:R;code_autorisation:A;erreur:E;numero_appel:T;numero_transaction:S;signature:K'
d['PBX_HASH'] = 'SHA512'
d['PBX_TIME'] = kwargs.get('time') or (force_text(datetime.datetime.utcnow().isoformat('T')).split('.')[0]+'+00:00')
d['PBX_ARCHIVAGE'] = transaction_id
@@ -282,7 +282,7 @@ class Payment(PaymentCommon):
data = []
if callback:
for key in ('montant', 'reference', 'code_autorisation',
- 'erreur'):
+ 'erreur', 'numero_appel', 'numero_transaction'):
data.append('%s=%s' % (key, urllib.quote(d[key][0])))
else:
for key, value in urlparse.parse_qsl(query_string, True, True):
diff --git a/tests/test_paybox.py b/tests/test_paybox.py
index 8d7952a..93d3c32 100644
--- a/tests/test_paybox.py
+++ b/tests/test_paybox.py
@@ -60,14 +60,14 @@ class PayboxTests(TestCase):
'PBX_RANG': '01',
'PBX_SITE': '12345678',
'PBX_IDENTIFIANT': '12345678',
- 'PBX_RETOUR': 'montant:M;reference:R;code_autorisation:A;erreur:E;signature:K',
+ 'PBX_RETOUR': 'montant:M;reference:R;code_autorisation:A;erreur:E;numero_appel:T;numero_transaction:S;signature:K',
'PBX_TIME': time,
'PBX_PORTEUR': email,
'PBX_CMD': order_id + eopayment.common.ORDERID_TRANSACTION_SEPARATOR + transaction,
'PBX_TOTAL': amount.replace('.', ''),
'PBX_DEVISE': '978',
'PBX_HASH': 'SHA512',
- 'PBX_HMAC': '173483CFF84A7ECF21039F99E9A95C5FB53D98A1562184F5B2C4543E4F87BFA227CC2CA10DE989D6C8B4DC03BC2ED44B7D7BDF5B4FABA8274D5D37C2F6445F36',
+ 'PBX_HMAC': 'D90B0D2B1C8BF67A2FC54AE56A026ABC6ABE17F2B976B993355CD9E6690A0EBB70ED18D67CB8D492B330C4EA76720CB492B8B4D033D8C2163C9B2D012B19BEAA',
'PBX_ARCHIVAGE': '1234',
'PBX_REPONDRE_A': 'http://example.com/callback',
}