Commit 82115e56 authored by Łukasz Nowak's avatar Łukasz Nowak

Do not convert dates.

In case of navigate the caller is responsible for providing date as text string.
parent d09f5528
...@@ -186,8 +186,7 @@ class PayzenService(XMLObject, PayzenSOAP): ...@@ -186,8 +186,7 @@ class PayzenService(XMLObject, PayzenSOAP):
"""See Payment Service Interface Documentation""" """See Payment Service Interface Documentation"""
pass pass
def _getSignature(self, ob, sorted_key_list, def _getSignature(self, ob, sorted_key_list):
output_date_format='%Y-%m-%dT%H:%M:%S', signature_date_format='%Y%m%d'):
"""Calculates signature from ob """Calculates signature from ob
ob can be dict or getattr capable object ob can be dict or getattr capable object
...@@ -211,7 +210,7 @@ class PayzenService(XMLObject, PayzenSOAP): ...@@ -211,7 +210,7 @@ class PayzenService(XMLObject, PayzenSOAP):
v = '' v = ''
elif isinstance(v, datetime.datetime): elif isinstance(v, datetime.datetime):
# for sure date # for sure date
v = v.strftime(signature_date_format) v = v.strftime('%Y%m%d')
else: else:
# anything else cast to string # anything else cast to string
v = str(v) v = str(v)
...@@ -230,8 +229,7 @@ class PayzenService(XMLObject, PayzenSOAP): ...@@ -230,8 +229,7 @@ class PayzenService(XMLObject, PayzenSOAP):
vads_version=self.getPayzenVadsVersion() vads_version=self.getPayzenVadsVersion()
) )
# fetch all prepared vads_ values and remove them from dict # fetch all prepared vads_ values and remove them from dict
signature = self._getSignature(payzen_dict, signature = self._getSignature(payzen_dict, sorted(payzen_dict.keys()))
sorted(payzen_dict.keys()), '%Y%m%d%H%M%S', '%Y%m%d%H%M%S')
payzen_dict['signature'] = signature payzen_dict['signature'] = signature
field_list = [] field_list = []
for k,v in payzen_dict.iteritems(): for k,v in payzen_dict.iteritems():
......
42 43
\ No newline at end of file \ 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