summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerghei Mihai <smihai@entrouvert.com>2020-09-10 09:28:43 (GMT)
committerSerghei Mihai <smihai@entrouvert.com>2020-09-11 09:52:37 (GMT)
commit68242bd4355b15c53921611b7164086c2ff06363 (patch)
tree1e3feab44e14a08c59979ab463bcd1473da5016b
parent24459e80d0d25a75ec78fbbcfe6758b5399ba768 (diff)
downloadeopayment-68242bd4355b15c53921611b7164086c2ff06363.zip
eopayment-68242bd4355b15c53921611b7164086c2ff06363.tar.gz
eopayment-68242bd4355b15c53921611b7164086c2ff06363.tar.bz2
misc: do not convert parameters to text (#46520)v1.55
-rw-r--r--eopayment/__init__.py6
-rw-r--r--tests/test_paybox.py4
-rw-r--r--tests/test_tipi.py4
3 files changed, 5 insertions, 9 deletions
diff --git a/eopayment/__init__.py b/eopayment/__init__.py
index aab050f..6e27094 100644
--- a/eopayment/__init__.py
+++ b/eopayment/__init__.py
@@ -161,12 +161,8 @@ class Payment(object):
if capture_day <= 0:
raise ValueError("capture_date needs to be superior to the transaction date.")
- kwargs['capture_day'] = capture_day
+ kwargs['capture_day'] = force_text(capture_day)
- for param in kwargs:
- # encode all but bool input params to unicode
- if not isinstance(kwargs[param], bool):
- kwargs[param] = force_text(kwargs[param])
return self.backend.request(amount, **kwargs)
def response(self, query_string, **kwargs):
diff --git a/tests/test_paybox.py b/tests/test_paybox.py
index c251322..04dff51 100644
--- a/tests/test_paybox.py
+++ b/tests/test_paybox.py
@@ -155,7 +155,7 @@ class PayboxTests(TestCase):
backend = eopayment.Payment('paybox', params)
transaction_id, kind, what = backend.request(
Decimal(amount), email=email, orderid=order_id,
- transaction_id=transaction, time=time, capture_day=2)
+ transaction_id=transaction, time=time, capture_day='2')
root = ET.fromstring(str(what))
form_params = dict(((
@@ -171,7 +171,7 @@ class PayboxTests(TestCase):
backend = eopayment.Payment('paybox', params)
transaction_id, kind, what = backend.request(
Decimal(amount), email=email, orderid=order_id,
- transaction_id=transaction, time=time, capture_day=2)
+ transaction_id=transaction, time=time, capture_day='2')
root = ET.fromstring(str(what))
form_params = dict(((
diff --git a/tests/test_tipi.py b/tests/test_tipi.py
index c0f194f..3f525fa 100644
--- a/tests/test_tipi.py
+++ b/tests/test_tipi.py
@@ -27,8 +27,8 @@ def test_tipi():
p = eopayment.Payment('tipi', {'numcli': '12345'})
payment_id, kind, url = p.request(
amount=Decimal('123.12'),
- exer=9999,
- refdet=999900000000999999,
+ exer='9999',
+ refdet='999900000000999999',
objet='tout a fait',
email='info@entrouvert.com',
urlcl='http://example.com/tipi/test',