From 233099e7411d79ef4399ea5d5d4f9f48c1e64612 Mon Sep 17 00:00:00 2001 From: gnongsie Date: Tue, 17 Sep 2024 19:00:25 +0530 Subject: [PATCH 1/6] Updates for next version & Update README.md with latest versions --- README.md | 49 +++++++++++++++++-------------------------------- setup.py | 5 ++--- 2 files changed, 19 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index fc5fa13..3c6237d 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,15 @@ # Authorize.Net Python SDK -[![Travis CI Status](https://travis-ci.org/AuthorizeNet/sdk-python.svg?branch=master)](https://travis-ci.org/AuthorizeNet/sdk-python) -[![Coverage Status](https://coveralls.io/repos/github/AuthorizeNet/sdk-python/badge.svg?branch=master)](https://coveralls.io/github/AuthorizeNet/sdk-python?branch=master) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/AuthorizeNet/sdk-python/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/AuthorizeNet/sdk-python/?branch=master) +[![Authorize.net Python CI](https://github.com/AuthorizeNet/sdk-python/actions/workflows/python-workflow.yml/badge.svg?branch=master)](https://github.com/AuthorizeNet/sdk-python/actions/workflows/python-workflow.yml) [![PyPI](https://img.shields.io/pypi/v/authorizenet.svg)](https://badge.fury.io/py/authorizenet) ## Requirements -* For Python 2, Python 2.7 or greater -* For Python 3, Python 3.4 or later +* Python 3.6 or later * OpenSSL 1.0.2 or greater * An Authorize.Net account (see _Registration & Configuration_ section below) -_Note: Our goal is ensuring this SDK is compatible with Python 2.7+, 3.4+ and PyPy, but at the moment we're primarily testing against Python 2.7._ - +_Note: Support for Python 2.x and Python <=3.5 has been discontinued, due to EOL of the Python package._ ### Contribution - If you need information or clarification about Authorize.Net features, create an issue with your question. You can also search the [Authorize.Net developer community](https://community.developer.authorize.net/) for discussions related to your question. - Before creating pull requests, please read [the contributors guide](CONTRIBUTING.md). @@ -39,9 +35,9 @@ After you have your credentials, load them into the appropriate variables in you #### To set your API credentials for an API request: ```python - merchantAuth = apicontractsv1.merchantAuthenticationType() - merchantAuth.name = 'YOUR_API_LOGIN_ID' - merchantAuth.transactionKey = 'YOUR_TRANSACTION_KEY' + merchantAuth = apicontractsv1.merchantAuthenticationType() + merchantAuth.name = 'YOUR_API_LOGIN_ID' + merchantAuth.transactionKey = 'YOUR_TRANSACTION_KEY' ``` Never include your API Login ID and Transaction Key directly in a file in a publicly accessible portion of your website. As a best practice, define the API Login ID and Transaction Key in a constants file, and reference those constants in your code. @@ -50,7 +46,7 @@ Never include your API Login ID and Transaction Key directly in a file in a publ Authorize.Net maintains a complete sandbox environment for testing and development purposes. The sandbox environment is an exact replica of our production environment, with simulated transaction authorization and settlement. By default, this SDK is configured to use the sandbox environment. To switch to the production environment, use the `setenvironment` method on the controller before executing. For example: ```python # For PRODUCTION use - createtransactioncontroller.setenvironment(constants.PRODUCTION) + createtransactioncontroller.setenvironment(constants.PRODUCTION) ``` API credentials are different for each environment, so be sure to switch to the appropriate credentials when switching environments. @@ -61,14 +57,14 @@ Python SDK uses the logger _'authorizenet.sdk'_. By default, the logger in the S A sample logger configuration is given as below: ```python - import logging - logger = logging.getLogger('authorizenet.sdk') - handler = logging.FileHandler('anetSdk.log') - formatter = logging.Formatter('%(asctime)s %(name)-12s %(levelname)-8s %(message)s') - handler.setFormatter(formatter) - logger.addHandler(handler) - logger.setLevel(logging.DEBUG) - logger.debug('Logger set up for Authorizenet Python SDK complete') + import logging + logger = logging.getLogger('authorizenet.sdk') + handler = logging.FileHandler('anetSdk.log') + formatter = logging.Formatter('%(asctime)s %(name)-12s %(levelname)-8s %(message)s') + handler.setFormatter(formatter) + logger.addHandler(handler) + logger.setLevel(logging.DEBUG) + logger.debug('Logger set up for Authorizenet Python SDK complete') ``` @@ -103,19 +99,8 @@ When using the SDK to submit Chase Pay transactions, consider the following poin ## Building & Testing the SDK ### Requirements -- python 2.7 -- pyxb 1.2.5 - -Run the following to get pyxb and nosetests: -- pip install pyxb==1.2.5 -- pip install nose -- pip install lxml - -### Running the SDK Tests -- Tests available are: unit tests, mock tests, sample code -- use nosetests to run all unittests - -`>nosetests` +- Python 3.6 +- PyXB-X ### Testing Guide For additional help in testing your own code, Authorize.Net maintains a [comprehensive testing guide](http://developer.authorize.net/hello_world/testing_guide/) that includes test credit card numbers to use and special triggers to generate certain responses from the sandbox environment. diff --git a/setup.py b/setup.py index 6167092..61f5ff7 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='1.1.4', + version='1.1.5', description='Authorize.Net Python SDK', @@ -48,8 +48,7 @@ # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.4' + 'Programming Language :: Python :: >=3.6' ], # What does your project relate to? From a5c49ebea89159d905f25607657d6f8689d9e88f Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Nongsiej Date: Wed, 18 Sep 2024 22:27:31 +0530 Subject: [PATCH 2/6] Fixed errors --- setup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 61f5ff7..deb405b 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,13 @@ # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. - 'Programming Language :: Python :: >=3.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', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12' ], # What does your project relate to? From 691d0b65db3b8501287b78bfda54d66c6bde50d4 Mon Sep 17 00:00:00 2001 From: gnongsie Date: Thu, 19 Sep 2024 20:31:03 +0530 Subject: [PATCH 3/6] Changed sample code branch to master --- .github/workflows/python-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-workflow.yml b/.github/workflows/python-workflow.yml index b84c9a0..870f33f 100644 --- a/.github/workflows/python-workflow.yml +++ b/.github/workflows/python-workflow.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v4 with: repository: 'authorizenet/sample-code-python' - ref: 'future' # Remove this line before pushing to master branch + ref: 'master' path: ${{env.sample_code_python}} - name: Install Python From 8ceafb55d3ba1f8dbb4175bbe168aa62c21c7aaa Mon Sep 17 00:00:00 2001 From: gnongsie Date: Tue, 15 Apr 2025 16:07:35 +0530 Subject: [PATCH 4/6] Removed use of outdated setup.cfg --- DESCRIPTION.rst | 26 -------------------------- setup.cfg | 2 -- setup.py | 3 +++ 3 files changed, 3 insertions(+), 28 deletions(-) delete mode 100644 DESCRIPTION.rst delete mode 100644 setup.cfg diff --git a/DESCRIPTION.rst b/DESCRIPTION.rst deleted file mode 100644 index 69af45f..0000000 --- a/DESCRIPTION.rst +++ /dev/null @@ -1,26 +0,0 @@ -# sdk-python [![Build Status](https://magnum.travis-ci.com/egodolja/sdk-python.svg?token=9z5hnp59uHpbBpKa445s&branch=master)](https://magnum.travis-ci.com/egodolja/sdk-python) -Python SDK for the Authorize.Net API - -Python - demo version commit -06/25/2015 - -Installations --------------------------------------- -- python 2.7 -- pyxb 1.2.5 - *install python before pyxb - - -Generating classes from xsd --------------------------------------- -- run generateObjectsFromXSD.bat script - - -Testing Controllers --------------------------------------- -- each controller has its corresponding test -- results recorded in the log - -Testing demoTest --------------------------------------- -- uncomment the commented out helper function in ARBCreateSubscriptionController to run demoTest diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 68ebb3d..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[metadata] -description-file = DESCRIPTION.rst \ No newline at end of file diff --git a/setup.py b/setup.py index deb405b..efedf7a 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,8 @@ here = path.abspath(path.dirname(__file__)) +with open(path.join(here, 'README.md'), encoding='utf-8') as f: + long_description = f.read() setup( name='authorizenet', @@ -20,6 +22,7 @@ version='1.1.5', description='Authorize.Net Python SDK', + long_description=long_description, # The project's main homepage. url='https://github.com/AuthorizeNet/sdk-python', From 59350cdfad24b7325c015553132582fa05e0b898 Mon Sep 17 00:00:00 2001 From: gnongsie Date: Mon, 28 Apr 2025 11:41:02 +0530 Subject: [PATCH 5/6] Upgrade to new version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index efedf7a..7bc8fb9 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='1.1.5', + version='1.1.6', description='Authorize.Net Python SDK', long_description=long_description, From 2d7ee348c55216e2289662c8b45f134dc09ca816 Mon Sep 17 00:00:00 2001 From: gnongsie Date: Mon, 28 Apr 2025 12:05:08 +0530 Subject: [PATCH 6/6] Corrected content type of description --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 7bc8fb9..f384046 100644 --- a/setup.py +++ b/setup.py @@ -23,6 +23,7 @@ description='Authorize.Net Python SDK', long_description=long_description, + long_description_content_type='text/markdown', # The project's main homepage. url='https://github.com/AuthorizeNet/sdk-python',