summaryrefslogtreecommitdiffstats
path: root/eopayment
diff options
context:
space:
mode:
authorSerghei Mihai <smihai@entrouvert.com>2016-10-20 14:57:28 (GMT)
committerSerghei Mihai <smihai@entrouvert.com>2016-10-21 14:09:00 (GMT)
commitd6b80acd0241d31788abc9240ebc65b9f97e6335 (patch)
tree729ea7e828e9dd78a0d9abe04e79a84f01799626 /eopayment
parent14f3ad83891b0eed213de595ecbca8c731a69401 (diff)
downloadeopayment-d6b80acd0241d31788abc9240ebc65b9f97e6335.zip
eopayment-d6b80acd0241d31788abc9240ebc65b9f97e6335.tar.gz
eopayment-d6b80acd0241d31788abc9240ebc65b9f97e6335.tar.bz2
ogone: handle properly unicode params (#13592)
Diffstat (limited to 'eopayment')
-rw-r--r--eopayment/ogone.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/eopayment/ogone.py b/eopayment/ogone.py
index 0872a34..e7c4569 100644
--- a/eopayment/ogone.py
+++ b/eopayment/ogone.py
@@ -6,7 +6,7 @@ from decimal import Decimal, ROUND_HALF_UP
from common import (PaymentCommon, PaymentResponse, FORM, CANCELLED, PAID,
ERROR, Form, DENIED, ACCEPTED, ORDERID_TRANSACTION_SEPARATOR,
- ResponseError)
+ ResponseError, force_byte)
def N_(message): return message
ENVIRONMENT_TEST = 'TEST'
@@ -458,9 +458,10 @@ class Payment(PaymentCommon):
values = params.items()
values = [(a.upper(), b) for a, b in values]
values = sorted(values)
- values = ['%s=%s' % (a, b) for a, b in values if a in keep]
+ values = [u'%s=%s' % (a, b) for a, b in values if a in keep]
tosign = key.join(values)
tosign += key
+ tosign = force_byte(tosign)
hashing = getattr(hashlib, algo)
return hashing(tosign).hexdigest().upper()
@@ -513,10 +514,10 @@ class Payment(PaymentCommon):
params['COM'] = description
for key, value in kwargs.iteritems():
params[key.upper()] = value
+ params['SHASIGN'] = self.sha_sign_in(params)
# uniformize all values to UTF-8 string
for key in params:
params[key] = unicode(params[key]).encode('utf-8')
- params['SHASIGN'] = self.sha_sign_in(params)
url = self.get_request_url()
form = Form(
url=url,