summaryrefslogtreecommitdiffstats
path: root/eopayment
diff options
context:
space:
mode:
authorSerghei Mihai <smihai@entrouvert.com>2018-10-23 18:30:34 (GMT)
committerSerghei Mihai <smihai@entrouvert.com>2018-10-25 14:27:13 (GMT)
commit0e6a724231e501287f8c3593e2691f7e22f06c01 (patch)
treedc7a0324e3a426f28824cef4ec42a94838b0847f /eopayment
parentd2b5f91e63422dd6f67abda448cdc45f4187b095 (diff)
downloadeopayment-0e6a724231e501287f8c3593e2691f7e22f06c01.zip
eopayment-0e6a724231e501287f8c3593e2691f7e22f06c01.tar.gz
eopayment-0e6a724231e501287f8c3593e2691f7e22f06c01.tar.bz2
paybox: decode correctly responses of validation and cancellation operations (#27543)
Diffstat (limited to 'eopayment')
-rw-r--r--eopayment/paybox.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/eopayment/paybox.py b/eopayment/paybox.py
index ec4d479..b9f79be 100644
--- a/eopayment/paybox.py
+++ b/eopayment/paybox.py
@@ -364,8 +364,9 @@ 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 data.get('CODEREPONSE') != PAYBOX_DIRECT_SUCCESS_RESPONSE_CODE:
- raise ResponseError(data.get('COMMENTAIRE'))
+ raise ResponseError(data['COMMENTAIRE'].encode('utf-8'))
return data
def validate(self, amount, bank_data, **kwargs):