summaryrefslogtreecommitdiffstats
path: root/tests/test_ogone.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_ogone.py')
-rw-r--r--tests/test_ogone.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/test_ogone.py b/tests/test_ogone.py
index f13aa6e..025dcdb 100644
--- a/tests/test_ogone.py
+++ b/tests/test_ogone.py
@@ -72,10 +72,25 @@ class OgoneTests(TestCase):
assert response.signed
self.assertEqual(response.order_id, order_id)
-
def test_bad_response(self):
ogone_backend = eopayment.Payment('ogone', BACKEND_PARAMS)
order_id = 'myorder'
data = {'payid': '32100123', 'status': 9, 'ncerror': 0}
with self.assertRaises(ResponseError):
response = ogone_backend.response(urllib.urlencode(data))
+
+ def test_bank_transfer_response(self):
+ ogone_backend = eopayment.Payment('ogone', BACKEND_PARAMS)
+ order_id = 'myorder'
+ data = {'orderid': u'myorder', 'status': u'41', 'payid': u'3011229363',
+ 'cn': u'User', 'ncerror': u'0',
+ 'trxdate': u'10/24/16',
+ 'brand': 'Bank transfer', 'pm': 'bank transfer',
+ 'currency': u'eur', 'amount': u'7.5',
+ 'shasign': u'0E35F687ACBEAA6CA769E0ADDBD0863EB6C1678A'}
+ # uniformize to utf-8 first
+ for k in data:
+ data[k] = eopayment.common.force_byte(data[k])
+ response = ogone_backend.response(urllib.urlencode(data))
+ assert response.signed
+ assert response.result == eopayment.WAITING