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,22 +209,9 @@ class PayzenService(XMLObject, PayzenSOAP):
if v is None:
# empty or not transmitted -- add as empty
v = ''
elif getattr(v, 'strftime', None) is not None:
elif isinstance(v, datetime.datetime):
# 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)
else:
# anything else cast to string
v = str(v)
......
41
\ No newline at end of file
42
\ 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