Commit f601ecc6 authored by Łukasz Nowak's avatar Łukasz Nowak

Do not convert too much.

suds library understands datetime.datetime objects, so do *NOT* convert them
to strings.
parent 3f601447
...@@ -209,21 +209,8 @@ class PayzenService(XMLObject, PayzenSOAP): ...@@ -209,21 +209,8 @@ class PayzenService(XMLObject, PayzenSOAP):
if v is None: if v is None:
# empty or not transmitted -- add as empty # empty or not transmitted -- add as empty
v = '' v = ''
elif getattr(v, 'strftime', None) is not None: elif isinstance(v, datetime.datetime):
# for sure date # for sure date
# Manipulate a dict
if isdict:
ob[k] = v.strftime(output_date_format)
# set acceptable date in signature
v = v.strftime(signature_date_format)
elif k.lower().endswith('date'):
# maybe date?
try:
v = datetime.datetime.strptime(str(v), '%Y-%m-%d %H:%M:%S')
except Exception:
v = str(v)
else:
ob[k] = v.strftime(output_date_format)
v = v.strftime(signature_date_format) v = v.strftime(signature_date_format)
else: else:
# anything else cast to string # anything else cast to string
......
41 42
\ 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