From 40e2c280c73d7826ebd634e177dfbd9307114c22 Mon Sep 17 00:00:00 2001 From: "has.well" Date: Mon, 26 Sep 2022 11:34:02 +0300 Subject: [PATCH 1/2] release_1.0.4 --- cloudipsp/__init__.py | 2 +- cloudipsp/configuration.py | 1 - setup.py | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cloudipsp/__init__.py b/cloudipsp/__init__.py index 91d6c3c..26a513e 100644 --- a/cloudipsp/__init__.py +++ b/cloudipsp/__init__.py @@ -1,4 +1,4 @@ -from cloudipsp.configuration import __version__, __api_url__ +from cloudipsp.configuration import __api_url__ from cloudipsp.api import Api from cloudipsp.checkout import Checkout from cloudipsp.order import Order diff --git a/cloudipsp/configuration.py b/cloudipsp/configuration.py index 73b006f..f7b1bba 100644 --- a/cloudipsp/configuration.py +++ b/cloudipsp/configuration.py @@ -1,4 +1,3 @@ -__version__ = '1.0.3' __api_url__ = 'https://{api_domain}/api' __sign_sep__ = '|' __protocol__ = '1.0' diff --git a/setup.py b/setup.py index fd63133..3ef09a7 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,5 @@ from setuptools import find_packages, setup -from cloudipsp.configuration import __version__ - desc = """ Cloudipsp python sdk. Docs - https://docs.fondy.eu/ @@ -15,7 +13,7 @@ setup( name='cloudipsp', - version=__version__, + version='1.0.4', url='https://github.com/cloudipsp/python-sdk/', license='MIT', description='Python SDK for cloudipsp clients.', @@ -35,4 +33,6 @@ 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', ]) From dc11422b624f8ef42162b624949c224a0e4810e1 Mon Sep 17 00:00:00 2001 From: "has.well" Date: Mon, 26 Sep 2022 11:42:40 +0300 Subject: [PATCH 2/2] test --- cloudipsp/utils.py | 6 +++++- tests/data/test_data.json | 8 ++++---- tests/order_tests.py | 2 +- tox.ini | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cloudipsp/utils.py b/cloudipsp/utils.py index ee06e56..1b80b93 100644 --- a/cloudipsp/utils.py +++ b/cloudipsp/utils.py @@ -120,7 +120,11 @@ def _data2xml(d): def _parse(node): tree = {} - for c in node.getchildren(): + try: + parsed_node = node.getchildren() + except AttributeError: + parsed_node = list(node) + for c in parsed_node: c_tag = c.tag c_attr = c.attrib ctext = c.text.strip() if c.text is not None else '' diff --git a/tests/data/test_data.json b/tests/data/test_data.json index c1ddca1..a64710a 100644 --- a/tests/data/test_data.json +++ b/tests/data/test_data.json @@ -12,22 +12,22 @@ }, "order_full_data": { "amount": "100", - "currency": "RUB" + "currency": "UAH" }, "payment_p2p": { "receiver_card_number": "4444555566661111", - "currency": "RUB", + "currency": "UAH", "amount": "100" }, "payment_pcidss_non3ds": { - "currency": "RUB", + "currency": "UAH", "amount": "100", "card_number": "4444555511116666", "cvv2": "123", "expiry_date": "1224" }, "payment_pcidss_3ds": { - "currency": "RUB", + "currency": "UAH", "amount": "100", "card_number": "4444555566661111", "cvv2": "123", diff --git a/tests/order_tests.py b/tests/order_tests.py index 0c98755..8970581 100644 --- a/tests/order_tests.py +++ b/tests/order_tests.py @@ -25,7 +25,7 @@ def test_get_order_trans_list(self): } response = self.order.transaction_list(data) self.assertIsInstance(response, list) - self.assertIn('order_id', response[0]) + self.assertIn('order_id', response[0] if len(response) else '') def test_refund(self): data = { diff --git a/tox.ini b/tox.ini index 4d50cda..176972a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py34, py35, py36, py37 +envlist = py27, py34, py35, py36, py37, py38, py39 [testenv] commands =