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.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/test_paybox.py b/tests/test_paybox.py
index 9f38090..443d811 100644
--- a/tests/test_paybox.py
+++ b/tests/test_paybox.py
@@ -253,3 +253,33 @@ ZdzrudBlevZXpr6iYwIDAQAB
z0Dkz0NjxvU+5WzQZh9Uuxr/egRCwV4NMRWqu0zaVVioeBvl4/5CWm4f4/1L9+0m
FBFKOZhgBJnkC+l6+XhT4aYWKaQ4ocmOMV92yjeXTE4='''
self.assertTrue(paybox.verify(data, base64.b64decode(sig64), key=pkey))
+
+ def test_request_manual_validation(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'
+
+ 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.assertIn('PBX_AUTOSEULE', form_params)
+ self.assertEqual(form_params['PBX_AUTOSEULE'], 'N')
+
+ transaction_id, kind, what = backend.request(
+ Decimal(amount), email=email, orderid=order_id,
+ transaction_id=transaction, time=time, manual_validation=True)
+ root = ET.fromstring(str(what))
+ form_params = dict((
+ (node.attrib['name'], node.attrib['value']) for node in root
+ if node.attrib['type'] == 'hidden'))
+ self.assertIn('PBX_AUTOSEULE', form_params)
+ self.assertEqual(form_params['PBX_AUTOSEULE'], 'O')