summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2020-06-17 05:51:45 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2020-06-17 05:51:45 (GMT)
commit6ebcd4c6743a154476c4e7c76b914b5de2e4ce55 (patch)
tree888153c754b6d444e42a9e4623745b000f46ca54
parent6c81d9733dd8657456bd44119fb1f3fd689831bf (diff)
downloadeopayment-6ebcd4c6743a154476c4e7c76b914b5de2e4ce55.zip
eopayment-6ebcd4c6743a154476c4e7c76b914b5de2e4ce55.tar.gz
eopayment-6ebcd4c6743a154476c4e7c76b914b5de2e4ce55.tar.bz2
ogone: use iso-8859-15 encoding for signature (#44150)
-rw-r--r--eopayment/ogone.py2
-rw-r--r--tests/test_ogone.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/eopayment/ogone.py b/eopayment/ogone.py
index dc304b3..9d759ef 100644
--- a/eopayment/ogone.py
+++ b/eopayment/ogone.py
@@ -496,7 +496,7 @@ class Payment(PaymentCommon):
values = [u'%s=%s' % (a, b) for a, b in values if a in keep and b]
tosign = key.join(values)
tosign += key
- tosign = force_byte(tosign)
+ tosign = force_byte(tosign, encoding='iso-8859-1')
hashing = getattr(hashlib, algo)
return hashing(tosign).hexdigest().upper()
diff --git a/tests/test_ogone.py b/tests/test_ogone.py
index 0aefe25..c8624a9 100644
--- a/tests/test_ogone.py
+++ b/tests/test_ogone.py
@@ -79,7 +79,7 @@ class OgoneTests(TestCase):
'cn': u'Usér', 'ncerror': u'0',
'trxdate': u'10/24/16', 'acceptance': u'test123',
'currency': u'eur', 'amount': u'7.5',
- 'shasign': u'3EE0CF69B5A8514962C9CF8A545861F0CA1C6891'}
+ 'shasign': u'CA4B3C2767B5EFAB33B9122A5D4CF6F27747303D'}
# uniformize to utf-8 first
for k in data:
data[k] = eopayment.common.force_byte(data[k])
@@ -96,7 +96,7 @@ class OgoneTests(TestCase):
'&CARDNO=XXXXXXXXXXXX9999&ED=0118'
'&CN=Miha%EF+Serghe%EF&TRXDATE=10%2F24%2F16'
'&PAYID=3011228911&NCERROR=0&BRAND=MasterCard'
- '&IP=80%2E12%2E92%2E47&SHASIGN=435D5E36E1F4B17739C1054FFD204218E65C15AB'
+ '&IP=80%2E12%2E92%2E47&SHASIGN=C429BE892FACFBFCE5E2CC809B102D866DD3D48C'
)
response = ogone_backend.response(backend_response)
assert response.signed
@@ -121,7 +121,7 @@ class OgoneTests(TestCase):
'pm': 'bank transfer',
'currency': u'eur',
'amount': u'7.5',
- 'shasign': u'0E35F687ACBEAA6CA769E0ADDBD0863EB6C1678A'
+ 'shasign': u'944CBD1E010BA4945415AE4B16CC40FD533F6CE2',
}
# uniformize to utf-8 first
for k in data: