Commit 2a85fcdf authored by Łukasz Nowak's avatar Łukasz Nowak

Return raw data too.

Also document method a bit.
parent aa8c33dd
...@@ -13,7 +13,20 @@ except ImportError: ...@@ -13,7 +13,20 @@ except ImportError:
else: else:
import time import time
class PayzenSOAP: class PayzenSOAP:
"""SOAP communication
Methods are returning list of:
* parsed response
* sent XML
* received XML
SOAP protocol is assumed as untrusted and dangerous, users of those methods
are encouraged to log such messages for future debugging."""
def soap_getInfo(self, transmissionDate, transactionId): def soap_getInfo(self, transmissionDate, transactionId):
"""Returns getInfo
transmissionDate is "raw" date in format YYYYMMDD, without any marks
transactionId is id of transaction for this date"""
client = suds.client.Client(self.wsdl_link.getUrlString()) client = suds.client.Client(self.wsdl_link.getUrlString())
sorted_keys = ('shopId', 'transmissionDate', 'transactionId', sorted_keys = ('shopId', 'transmissionDate', 'transactionId',
'sequenceNb', 'ctxMode') 'sequenceNb', 'ctxMode')
...@@ -35,7 +48,8 @@ else: ...@@ -35,7 +48,8 @@ else:
signature += str(v) + '+' signature += str(v) + '+'
signature += self.getServicePassword() signature += self.getServicePassword()
kw['wsSignature'] = hashlib.sha1(signature).hexdigest() kw['wsSignature'] = hashlib.sha1(signature).hexdigest()
return client.service.getInfo(**kw) data = client.service.getInfo(**kw)
return [data, str(client.last_sent()), str(client.last_received())]
class PayzenService(XMLObject, PayzenSOAP): class PayzenService(XMLObject, PayzenSOAP):
meta_type = 'Payzen Service' meta_type = 'Payzen Service'
......
23 24
\ 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