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

Fix from string date manipulation.

parent 1634c4a5
...@@ -5,6 +5,7 @@ from Products.ERP5Type.XMLObject import XMLObject ...@@ -5,6 +5,7 @@ from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.Document import newTempDocument from Products.ERP5Type.Document import newTempDocument
import hashlib import hashlib
from zLOG import LOG, WARNING from zLOG import LOG, WARNING
import datetime
try: try:
import suds import suds
...@@ -12,7 +13,6 @@ except ImportError: ...@@ -12,7 +13,6 @@ except ImportError:
class PayzenSOAP: class PayzenSOAP:
pass pass
else: else:
import time
class PayzenSOAP: class PayzenSOAP:
"""SOAP communication """SOAP communication
...@@ -219,10 +219,12 @@ class PayzenService(XMLObject, PayzenSOAP): ...@@ -219,10 +219,12 @@ class PayzenService(XMLObject, PayzenSOAP):
elif k.lower().endswith('date'): elif k.lower().endswith('date'):
# maybe date? # maybe date?
try: try:
v = time.strftime('%Y%m%d', time.strptime(str(v), v = datetime.datetime.strptime(str(v), '%Y-%m-%d %H:%M:%S')
'%Y-%m-%d %H:%M:%S'))
except Exception: except Exception:
v = str(v) v = str(v)
else:
ob[k] = v.strftime(output_date_format)
v = v.strftime(signature_date_format)
else: else:
# anything else cast to string # anything else cast to string
v = str(v) v = str(v)
......
36 37
\ 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