From 68242bd4355b15c53921611b7164086c2ff06363 Mon Sep 17 00:00:00 2001 From: Serghei Mihai Date: Thu, 10 Sep 2020 11:28:43 +0200 Subject: [PATCH] misc: do not convert parameters to text (#46520) --- eopayment/__init__.py | 6 +----- tests/test_paybox.py | 4 ++-- tests/test_tipi.py | 4 ++-- 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',