From 1d66e570aa75cee585743c6dc61879676b520833 Mon Sep 17 00:00:00 2001 From: Abel Puentes Luberta Date: Thu, 31 Aug 2017 09:24:59 +0200 Subject: [PATCH] Better support for Python 3 (#4) --- sofort/client.py | 2 +- sofort/model.py | 2 +- sofort/xml.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sofort/client.py b/sofort/client.py index 4b24c85..86e888c 100644 --- a/sofort/client.py +++ b/sofort/client.py @@ -7,7 +7,7 @@ from sofort.internals import Config, as_list from sofort import model -from _version import __version__ +from sofort._version import __version__ API_URL = 'https://api.sofort.com/api/xml' TRANSACTION_ID = '-TRANSACTION-' diff --git a/sofort/model.py b/sofort/model.py index d538d85..bf31f8c 100644 --- a/sofort/model.py +++ b/sofort/model.py @@ -14,7 +14,7 @@ def response(xmlstr): result = xmltodict.parse(xmlstr) # only one root element is allowed in XML - for root, value in result.iteritems(): + for root, value in result.items(): if value is None: return None factory = factories[root] diff --git a/sofort/xml.py b/sofort/xml.py index ff76d70..a78c859 100644 --- a/sofort/xml.py +++ b/sofort/xml.py @@ -59,7 +59,7 @@ def multipay(config): def transaction_request_by_params(params): root = etree.Element('transaction_request') root.set('version', '2') - for name, value in params.iteritems(): + for name, value in params.items(): if name == 'transaction': for transaction_id in value: etree.SubElement(root, 'transaction').text = transaction_id