AuthorizeNet/sample-code-python

ImportError: No module named _vendor

gpetty opened this issue · 3 comments

I am working with the SDK for the first time and have installed the authorizenet module under Python 2.7.
My first attempt to run an example yields the traceback appended below. It's possible that I'm missing some other setup requirement, but my impression was that the examples should work right out of the box.

python PaymentTransactions/charge-credit-card.py

Traceback (most recent call last):
File "PaymentTransactions/charge-credit-card.py", line 5, in
from authorizenet.apicontrollers import *
File "/Users/gpetty/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/authorizenet/apicontrollers.py", line 9, in
from authorizenet import apicontrollersbase
File "/Users/gpetty/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/authorizenet/apicontrollersbase.py", line 9, in
from pip._vendor import requests
ImportError: No module named _vendor

tmpkn commented

pip install -U pip

That will help you with your _vendor error.

Having said that, for the past 2 days AuthorizeNet Python SDK has been useless due to a change in their API which prevents their XML responses to be properly parsed by their own client library. You will get an error due to a fact that transactionController.getresponse() returns None

I am speachless as to how they managed to push this bug into production. Their own test runner catches it in 2 seconds.

Thanks; that did indeed solve the _vendor error. And I do now get the NoneType problem with the response.

There are also other warnings that I don't know how to interpret:

/Users/gpetty/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/Users/gpetty/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Traceback (most recent call last):
File "PaymentTransactions/charge-credit-card.py", line 45, in
charge_credit_card(constants.amount)
File "PaymentTransactions/charge-credit-card.py", line 37, in charge_credit_card
if (response.messages.resultCode=="Ok"):
AttributeError: 'NoneType' object has no attribute 'messages'

Hi guys, Python is our very latest SDK and we messed up communication between the API team and the SDK team on our release this week which resulted in this breaking change. Our bad and we have corrected the processes to ensure this does not happen again. The issue is fixed in version 1.0.9 which is now available on PyPI & GitHub.
Our Python community is growing and very important to us, please let us know if you have any further issues or indeed have any feedback at all.

Thanks again for reporting this issue and for your patience while we resolved it.

Brian