summaryrefslogtreecommitdiff
path: root/addons/payment_authorize/models/authorize_request.py
diff options
context:
space:
mode:
authorDamien Bouvy <dbo@odoo.com>2017-11-20 19:22:56 +0100
committerDamien Bouvy <dbo@odoo.com>2017-11-20 19:22:56 +0100
commit93b5ce67ac4ee6ba00848ff4dd95e3ba1dab2dbb (patch)
tree73ad0b6362a2d26a03098cc263cfea1181ef6fc1 /addons/payment_authorize/models/authorize_request.py
parentf4a54d7f664b03c3c692f114b59cb814603e848c (diff)
Revert "[FIX] payment_authorize: add some debug logging"
This reverts commit fb093726d78b07a322d56b4848a361de93536b1f. In my hurry, I forgot part of this debug feature, which made it crash because I tried to stringify a element instead of a tree
Diffstat (limited to 'addons/payment_authorize/models/authorize_request.py')
-rw-r--r--addons/payment_authorize/models/authorize_request.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/addons/payment_authorize/models/authorize_request.py b/addons/payment_authorize/models/authorize_request.py
index 6e0987b2de6..1ae0e71b6ed 100644
--- a/addons/payment_authorize/models/authorize_request.py
+++ b/addons/payment_authorize/models/authorize_request.py
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
from lxml import etree, objectify
-import logging
from urllib2 import urlopen, Request
from StringIO import StringIO
import xml.etree.ElementTree as ET
@@ -12,8 +11,6 @@ from odoo import _
XMLNS = 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'
-_logger = logging.getLogger(__name__)
-
def strip_ns(xml, ns):
"""Strip the provided name from tag names.
@@ -61,13 +58,11 @@ class AuthorizeAPI():
:param etree._Element data: etree data to process
"""
- data_tree = etree.tostring(data, xml_declaration=True, encoding='utf-8')
- request = Request(self.url, data_tree)
+ data = etree.tostring(data, xml_declaration=True, encoding='utf-8')
+ request = Request(self.url, data)
request.add_header('Content-Type', 'text/xml')
- _logger.debug('Authorize.net request sent: \n%s', etree.tostring(data, pretty_print=True))
response = urlopen(request).read()
response = strip_ns(response, XMLNS)
- _logger.debug('Authorize.net response: \n%s', etree.tostring(response, pretty_print=True))
if response.find('messages/resultCode').text == 'Error':
messages = map(lambda m: m.text, response.findall('messages/message/text'))
raise ValidationError(_('Authorize.net Error Message(s):\n %s') % '\n'.join(messages))