~serpent-consulting-services/openerp-usa/shipping_api_6-1

« back to all changes in this revision

Viewing changes to account_payment_cim_authdotnet/wizard/delete_payment_profile.py

  • Committer: npgllc
  • Date: 2012-09-13 17:23:36 UTC
  • mfrom: (78.1.3 openerp-usa)
  • Revision ID: npgllc-20120913172336-tom9sako8yops2gx
[IMP]: account_payment_cim_authodotnet, account_payment_creditcard

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
from xml.dom.minidom import Document
25
25
import xml2dic
26
26
from tools.translate import _
 
27
import httplib
27
28
 
28
29
class delete_payment_profile(osv.osv_memory):
29
30
    _name = 'delete.payment.profile'
30
31
    _description = 'Delete Payment Profile'
31
32
 
32
33
    def request_to_server(self, Request_string, url, url_path):
33
 
            ''' Sends a POST request to url and returns the response from the server'''
 
34
        ''' Sends a POST request to url and returns the response from the server'''
34
35
 
35
 
            conn = httplib.HTTPSConnection(url)
36
 
            conn.putrequest('POST', url_path)
37
 
            conn.putheader('content-type', 'text/xml')
38
 
            conn.putheader('content-length', len(Request_string))
39
 
            conn.endheaders()
40
 
            conn.send(Request_string)
41
 
            response = conn.getresponse()
42
 
            create_CustomerProfile_response_xml = response.read()
43
 
            return create_CustomerProfile_response_xml
 
36
        conn = httplib.HTTPSConnection(url)
 
37
        conn.putrequest('POST', url_path)
 
38
        conn.putheader('content-type', 'text/xml')
 
39
        conn.putheader('content-length', len(Request_string))
 
40
        conn.endheaders()
 
41
        conn.send(Request_string)
 
42
        response = conn.getresponse()
 
43
        create_CustomerProfile_response_xml = response.read()
 
44
        return create_CustomerProfile_response_xml
44
45
 
45
46
    def search_dic(self, dic, key):
46
47
        ''' Returns the parent dictionary containing key None on Faliure'''
181
182
        return None
182
183
 
183
184
    _columns = {
184
 
                'payment_profile_id':fields.many2one('cust.payment.profile', 'Payment Profile', required=True),
 
185
        'payment_profile_id':fields.many2one('cust.payment.profile', 'Payment Profile', required=True),
185
186
        }
186
187
    _defaults = {
187
188
        'payment_profile_id':_get_profile_id