From 887fb687e5c27c6aafae94f6001f62f6eb7b67c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 16 Feb 2016 20:38:03 +0100 Subject: [PATCH] sips2: fix seal check (#10008) --- eopayment/sips2.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eopayment/sips2.py b/eopayment/sips2.py index c9ac20a..ea3583f 100644 --- a/eopayment/sips2.py +++ b/eopayment/sips2.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +import collections import urlparse import string from decimal import Decimal @@ -180,7 +181,7 @@ class Payment(PaymentCommon): def decode_data(self, data): data = data.split('|') data = [map(unicode, p.split('=')) for p in data] - return dict(data) + return collections.OrderedDict(data) def check_seal(self, data, seal): return seal == self.seal_data(data) @@ -197,7 +198,7 @@ class Payment(PaymentCommon): assert 'Seal' in form assert 'InterfaceVersion' in form data = self.decode_data(form['Data'][0]) - seal = form['Seal'] + seal = form['Seal'][0] self.logger.debug('parsed response %r seal %r', data, seal) signed = self.check_seal(data, seal) response_code = data['responseCode'] -- 2.7.0