summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerghei Mihai <smihai@entrouvert.com>2018-10-25 15:49:10 (GMT)
committerSerghei Mihai <smihai@entrouvert.com>2018-10-25 15:50:11 (GMT)
commit8df6db6fcd82794047646a15c71b71e2258485d7 (patch)
tree2594fcd34d985b8506e26c797c04d40592e8b3df
parent0e6a724231e501287f8c3593e2691f7e22f06c01 (diff)
downloadeopayment-8df6db6fcd82794047646a15c71b71e2258485d7.zip
eopayment-8df6db6fcd82794047646a15c71b71e2258485d7.tar.gz
eopayment-8df6db6fcd82794047646a15c71b71e2258485d7.tar.bz2
paybox: add python3 compat for transaction operations (#27543)
-rw-r--r--eopayment/paybox.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/eopayment/paybox.py b/eopayment/paybox.py
index b9f79be..e52f203 100644
--- a/eopayment/paybox.py
+++ b/eopayment/paybox.py
@@ -364,9 +364,12 @@ class Payment(PaymentCommon):
response.raise_for_status()
logger.debug('received %r', response.content)
data = dict(urlparse.parse_qsl(response.content, True, True))
- data['COMMENTAIRE'] = data.get('COMMENTAIRE', '').decode('iso-8859-1')
+ if six.PY2:
+ data['COMMENTAIRE'] = data.get('COMMENTAIRE', '').decode('iso-8859-1')
if data.get('CODEREPONSE') != PAYBOX_DIRECT_SUCCESS_RESPONSE_CODE:
- raise ResponseError(data['COMMENTAIRE'].encode('utf-8'))
+ if six.PY2:
+ raise ResponseError(data['COMMENTAIRE'].encode('utf-8'))
+ raise ResponseError(data['COMMENTAIRE'])
return data
def validate(self, amount, bank_data, **kwargs):