summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2017-10-11 08:09:44 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2017-10-11 08:15:08 (GMT)
commitfe53eb36dfcc1c06cf32b95c0a0fef3f5d9d67ff (patch)
tree0c468ee813e472b7d1d11611ec5e6681cc16be33 /tests
parent2d75c65935f23949f1f30cb4774bc1b6d9e080a1 (diff)
downloadeopayment-fe53eb36dfcc1c06cf32b95c0a0fef3f5d9d67ff.zip
eopayment-fe53eb36dfcc1c06cf32b95c0a0fef3f5d9d67ff.tar.gz
eopayment-fe53eb36dfcc1c06cf32b95c0a0fef3f5d9d67ff.tar.bz2
introduce a new "WAITING" status and use it for ogone (#19358)
Diffstat (limited to 'tests')
-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