From 9c7a1d4e649b0f9ef8f85b0e1b17fd3cbc452004 Mon Sep 17 00:00:00 2001 From: srathod Date: Wed, 2 Dec 2015 12:02:41 +0530 Subject: [PATCH 1/5] - XML response for ARBGetSubscriptionStatus was not parsed correctly throwing an UnrecognizedAttributeError. - This was due to "note:" and "" element not being removed from ARBGetSubscriptionStatusResponse correctly. - Fixed the call to special afterexecute method of ARBGetSubscriptionStatusController. --- authorizenet/apicontrollers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/authorizenet/apicontrollers.py b/authorizenet/apicontrollers.py index 4e4b68e..89c1440 100644 --- a/authorizenet/apicontrollers.py +++ b/authorizenet/apicontrollers.py @@ -111,13 +111,15 @@ def getresponseclass(self): ''' Returns the response class ''' return apicontractsv1.ARBGetSubscriptionStatusResponse() - def afterExecute(self, response): + def afterexecute(self): + response = self._httpResponse if constants.StatusStart in response: response = response.replace(constants.note, '') start = response.index(constants.StatusStart) end = response.index(constants.StatusEnd) response = response.replace(response[start:end+9], '') - return response + self._httpResponse = response + return class ARBUpdateSubscriptionController(apicontrollersbase.APIOperationBase): From 930a0e3ad8225332fb606f36940ea1ccc261df8d Mon Sep 17 00:00:00 2001 From: srathod Date: Thu, 3 Dec 2015 11:07:41 +0530 Subject: [PATCH 2/5] - Added sample-code-python as submodule. --- .gitmodules | 3 +++ .travis.yml | 4 ++++ sample-code-python | 1 + 3 files changed, 8 insertions(+) create mode 100644 .gitmodules create mode 160000 sample-code-python diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3aef977 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "sample-code-python"] + path = sample-code-python + url = https://github.com/AuthorizeNet/sample-code-python diff --git a/.travis.yml b/.travis.yml index cad78f3..7a377b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,8 @@ install: - pip install unittest2 - pip install nose - pip install pyxb + +before_script: + - git submodule update --remote --recursive + script: nosetests diff --git a/sample-code-python b/sample-code-python new file mode 160000 index 0000000..7e00de2 --- /dev/null +++ b/sample-code-python @@ -0,0 +1 @@ +Subproject commit 7e00de25aaa48e574e9f99b2396362b87085ed49 From 207e384f0d5f00fa7f82fe32c3c3315cce0a7ffb Mon Sep 17 00:00:00 2001 From: srathod Date: Thu, 3 Dec 2015 12:59:58 +0530 Subject: [PATCH 3/5] - For ARBGetSubscriptionStatus, in case of error in response, only "note" is sent in XML response and "" tag is not sent. - Hence modified the condition in afterexecute. --- authorizenet/apicontrollers.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/authorizenet/apicontrollers.py b/authorizenet/apicontrollers.py index 89c1440..f654bf7 100644 --- a/authorizenet/apicontrollers.py +++ b/authorizenet/apicontrollers.py @@ -113,12 +113,15 @@ def getresponseclass(self): def afterexecute(self): response = self._httpResponse - if constants.StatusStart in response: + if constants.note in response: response = response.replace(constants.note, '') + + if constants.StatusStart in response: start = response.index(constants.StatusStart) end = response.index(constants.StatusEnd) response = response.replace(response[start:end+9], '') - self._httpResponse = response + + self._httpResponse = response return class ARBUpdateSubscriptionController(apicontrollersbase.APIOperationBase): From fab926f48e31e69dc02ddbbf00917214c3bd7acf Mon Sep 17 00:00:00 2001 From: Sunny Raj Rathod Date: Fri, 4 Dec 2015 16:27:44 +0530 Subject: [PATCH 4/5] Update .travis.yml Added call to sample-code-python. --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7a377b5..078aea0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,4 +13,8 @@ install: before_script: - git submodule update --remote --recursive -script: nosetests +script: + - nosetests + - python setup.py install + - cd sample-code-python + - for i in `ls */*.py`;do python $i;done From 276dd664aec8669db6de72891602355f150c65b0 Mon Sep 17 00:00:00 2001 From: Brian McManus Date: Tue, 15 Dec 2015 00:55:12 -0800 Subject: [PATCH 5/5] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3d06d0e..1a39af4 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build Status](https://travis-ci.org/AuthorizeNet/sdk-python.png?branch=master)] (https://travis-ci.org/AuthorizeNet/sdk-python) +[![Coverage Status](https://coveralls.io/repos/AuthorizeNet/sdk-php/badge.svg?branch=master&service=github)](https://coveralls.io/github/AuthorizeNet/sdk-php?branch=master) `pip install authorizenet`