Commit 83bff170 authored by Łukasz Nowak's avatar Łukasz Nowak

Checkpoint: signature matches.

Non transmitted values shall result in ++
Empty (evaluated to None) values shall result in ++
parent ee7550e6
......@@ -47,7 +47,8 @@ else:
try:
v = getattr(data, k)
except AttributeError:
pass
# not transmitted: just add +
signature += '+'
else:
if k in ['transmissionDate', 'presentationDate', 'cardExpirationDate',
'markDate', 'authDate', 'captureDate']:
......@@ -55,8 +56,13 @@ else:
if isinstance(v, datetime.datetime):
v = v.strftime('%Y%m%d')
else:
v = time.strftime('%Y%m%d', time.strptime(str(v), '%Y-%m-%d %H:%M:%S'))
v = str(v)
v = time.strftime('%Y%m%d', time.strptime(str(v),
'%Y-%m-%d %H:%M:%S'))
if v is not None:
v = str(v)
else:
# empty transmitted: just add +
v = ''
signature += v + '+'
signature += self.getServicePassword()
signature = hashlib.sha1(signature).hexdigest()
......
32
\ No newline at end of file
33
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment