Exemplo n.º 1
0
 def build_soap(self, xml_dict):
     #TODO build this up properly
     soap_payload = '''<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
         <soapenv:Header>
             <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                 <wsse:UsernameToken>
                     <wsse:Username>%(merchant_id)s</wsse:Username>
                     <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">%(api_key)s</wsse:Password>
                 </wsse:UsernameToken>
             </wsse:Security>
         </soapenv:Header>
         <soapenv:Body>
         %(body)s
         </soapenv:Body>
     </soapenv:Envelope>
     '''
     root = ET.Element('requestMessage')
     root.attrib['xmlns'] = self.namespace
     dicttoxml(xml_dict, root)
     body = ET.tostring(root)
     return soap_payload % {
         'merchant_id': self.merchant_id,
         'api_key': self.api_key,
         'body': body,
     }
Exemplo n.º 2
0
 def send(self, data, response):
     root = ET.Element('XMLPayResponse', {'xmlns':'http://www.paypal.com/XMLPay'})
     msg = {'ResponseData': {'Vendor':data['RequestData']['Vendor'],
                             'Partner':data['RequestData']['Partner'],
                             'TransactionResults': {'TransactionResult': response }}}
     dicttoxml(msg, root)
     return root
Exemplo n.º 3
0
 def build_soap(self, xml_dict):
     #TODO build this up properly
     soap_payload = '''<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
         <soapenv:Header>
             <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                 <wsse:UsernameToken>
                     <wsse:Username>%(merchant_id)s</wsse:Username>
                     <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">%(api_key)s</wsse:Password>
                 </wsse:UsernameToken>
             </wsse:Security>
         </soapenv:Header>
         <soapenv:Body>
         %(body)s
         </soapenv:Body>
     </soapenv:Envelope>
     '''
     root = ET.Element('requestMessage')
     root.attrib['xmlns'] = self.namespace
     dicttoxml(xml_dict, root)
     body = ET.tostring(root)
     return soap_payload % {'merchant_id': self.merchant_id,
                            'api_key': self.api_key,
                            'body': body,}
 def send(self, data, response):
     root = ET.Element('Response')
     dicttoxml(response, root)
     return root
 def send(self, data, response):
     root = ET.Element('replyMessage')
     root.attrib['xmlns'] = self.namespace
     dicttoxml(response, root)
     return root
 def send(self, data, response):
     root = ET.Element('Response')
     dicttoxml(response, root)
     return root
Exemplo n.º 7
0
 def send(self, data, response):
     root = ET.Element('replyMessage')
     root.attrib['xmlns'] = self.namespace
     dicttoxml(response, root)
     return root