summaryrefslogtreecommitdiffstats
path: root/tests/test_paybox.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_paybox.py')
-rw-r--r--tests/test_paybox.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/test_paybox.py b/tests/test_paybox.py
index a0b8d9a..6f09be1 100644
--- a/tests/test_paybox.py
+++ b/tests/test_paybox.py
@@ -68,9 +68,10 @@ class PayboxTests(TestCase):
'PBX_TOTAL': amount.replace('.', ''),
'PBX_DEVISE': '978',
'PBX_HASH': 'SHA512',
- 'PBX_HMAC': 'D90B0D2B1C8BF67A2FC54AE56A026ABC6ABE17F2B976B993355CD9E6690A0EBB70ED18D67CB8D492B330C4EA76720CB492B8B4D033D8C2163C9B2D012B19BEAA',
+ 'PBX_HMAC': '6C70F35F9C6F6C9AB16D1E766EF981D241CB527C2E547205622DFFAF5B1B6C0F47E1DE2D3A1CE579F97AD19F87C3AE63E89B22F4B6D1E118685F5DD977891668',
'PBX_ARCHIVAGE': '1234',
'PBX_REPONDRE_A': 'http://example.com/callback',
+ 'PBX_AUTOSEULE': 'N'
}
form_params = {}
@@ -104,6 +105,24 @@ class PayboxTests(TestCase):
self.assertIn('PBX_DIFF', form_params)
self.assertEqual(form_params['PBX_DIFF'], '07')
+ def test_request_with_authorization_only(self):
+ params = BACKEND_PARAMS.copy()
+ time = '2018-08-21T10:26:32+02:00'
+ email = 'user@entrouvert.com'
+ order_id = '20180821'
+ transaction = '1234'
+ amount = '42.99'
+
+ params['capture_mode'] = 'AUTHOR_CAPTURE'
+ backend = eopayment.Payment('paybox', params)
+ transaction_id, kind, what = backend.request(
+ Decimal(amount), email=email, orderid=order_id,
+ transaction_id=transaction, time=time)
+ root = ET.fromstring(str(what))
+
+ form_params = dict(((node.attrib['name'], node.attrib['value']) for node in root if node.attrib['type'] == 'hidden'))
+ self.assertEqual(form_params['PBX_AUTOSEULE'], 'O')
+
def test_response(self):
backend = eopayment.Payment('paybox', BACKEND_PARAMS)
order_id = '20160216'