Skip to content

Updated SDK to 1.0.9 #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Mar 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
422b750
Update README.md
namanbansal Nov 27, 2015
8b19daa
Update README.md
namanbansal Nov 27, 2015
c8a36a1
Update .travis.yml
namanbansal Nov 27, 2015
5ec4d5d
Create .coveralls.yml
namanbansal Nov 27, 2015
915091e
Update apicontrollers.py
namanbansal Dec 2, 2015
ba7aedd
Update apicontrollers.py
namanbansal Dec 2, 2015
a191961
Update apicontrollers.py
namanbansal Dec 2, 2015
c5f4a87
Update .travis.yml
namanbansal Dec 2, 2015
8926970
Update .travis.yml
namanbansal Dec 2, 2015
834afe1
Update apicontrollers.py
namanbansal Dec 9, 2015
11a29fc
Merge branch 'master' of https://github.com/AuthorizeNet/sdk-python
namanbansal Mar 2, 2016
0ca6855
Add PyPi version badge to README.md
namanbansal Mar 2, 2016
24f7396
Removing coveralls.yml for now
namanbansal Mar 2, 2016
051c194
Point code quality widget to AuthorizeNet/sdk-python
namanbansal Mar 3, 2016
00f174d
- Updated sdk for Q1 changes.
Mar 3, 2016
b34a315
Update .travis.yml
sunnyrajrathod Mar 3, 2016
bf1d5f5
- Fixed the failing sampletests.
Mar 4, 2016
0f81cbe
Merge branch 'master' of https://github.com/sunnyrajrathod/sdk-python
Mar 4, 2016
5923ebc
- Uncommenting nosetests.
Mar 4, 2016
8ca4bfc
Update build widget
namanbansal Mar 4, 2016
742d4ba
Merge pull request #31 from sunnyrajrathod/master
sunnyrajrathod Mar 18, 2016
7119674
Merge pull request #30 from namanbansal/master
sunnyrajrathod Mar 18, 2016
2022b90
Update setup.py
sunnyrajrathod Mar 18, 2016
922b0ba
- Updated contracts for xsd changes.
Mar 25, 2016
4f59bf5
Merge pull request #35 from sunnyrajrathod/master
sunnyrajrathod Mar 25, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Authorize.Net Python SDK

[![Build Status](https://travis-ci.org/AuthorizeNet/sdk-python.png?branch=master)]
[![Travis](https://img.shields.io/travis/AuthorizeNet/sdk-python/master.svg)]
(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)
[![PyPI](https://img.shields.io/pypi/v/authorizenet.svg)](https://badge.fury.io/py/authorizenet)

`pip install authorizenet`

Expand Down
15 changes: 15 additions & 0 deletions anet_python_sdk_properties.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[properties]

#sandbox cradentials
api.login.id : 5KP3u95bQpv
transaction.key : 4Ktq966gC55GAX7S
md5.hash.key : MD5_HASH_KEY

#log
logfilename : logFile.log

#proxy setup
#http://proxy.yourcompany.com:80
#https://proxy.yourcompany.com:443


8,460 changes: 4,795 additions & 3,665 deletions authorizenet/apicontractsv1.py

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions authorizenet/apicontrollersbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
'''
import abc
import logging
import pyxb
import xml.dom.minidom
from pip._vendor import requests
from _pyio import __metaclass__
Expand Down Expand Up @@ -137,6 +138,9 @@ def execute(self):
self._response = apicontractsv1.CreateFromDocument(self._httpResponse)
except Exception as createfromdocumentexception:
logging.error( 'Create Document Exception: %s, %s', type(createfromdocumentexception), createfromdocumentexception.args )
pyxb.RequireValidWhenParsing(False)
self._response = apicontractsv1.CreateFromDocument(self._httpResponse)
pyxb.RequireValidWhenParsing(True)
else:
if type(self.getresponseclass()) == type(self._response):
if self._response.messages.resultCode == "Error":
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.0.7',
version='1.0.9',

description='Authorize.Net Python SDK',

Expand Down
6 changes: 3 additions & 3 deletions tests/apitestbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def setUp(self):
self.amount = str(round(random.random()*100, 2))

self.merchantAuthentication = apicontractsv1.merchantAuthenticationType()
self.merchantAuthentication.name = helper.getproperty('api_login_id')
self.merchantAuthentication.transactionKey = helper.getproperty('transaction_key')
self.merchantAuthentication.name = utility.helper.getproperty('api.login.id')
self.merchantAuthentication.transactionKey = utility.helper.getproperty('transaction.key')
self.ref_id = 'Sample'

self.dateOne = datetime.date(2020, 8, 30)
Expand Down Expand Up @@ -58,7 +58,7 @@ def setUp(self):
self.subscriptionOne.trialAmount = Decimal ('0.03')
self.subscriptionOne.payment = self.payment
self.subscriptionOne.billTo = self.customerOne

self.order = apicontractsv1.orderType()
self.order.invoiceNumber = "INV-21345"
self.order.description = "Product description"
Expand Down
38 changes: 22 additions & 16 deletions tests/testssample.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,28 @@

class test_ReadProperty(apitestbase.ApiTestBase):
def testPropertyFromFile(self):
login= utility.helper.getproperty("api_login_id")
transactionkey = utility.helper.getproperty("transaction_key")
login= utility.helper.getproperty("api.login.id")
transactionkey = utility.helper.getproperty("transaction.key")
self.assertIsNotNone(login)
self.assertIsNotNone(transactionkey)


class test_TransactionReportingUnitTest(apitestbase.ApiTestBase):
def testGetTransactionDetails(self):

gettransactiondetailsrequest = apicontractsv1.getTransactionDetailsRequest()
gettransactiondetailsrequest.merchantAuthentication = self.merchantAuthentication
gettransactiondetailsrequest.transId ='2244574222' #update valid transaction id
gettransactiondetailsrequest.transId ='2252271173' #update valid transaction id
gettransactiondetailscontroller = getTransactionDetailsController(gettransactiondetailsrequest)
gettransactiondetailscontroller.execute()
response = gettransactiondetailscontroller.getresponse()
self.assertEquals('Ok', response.messages.resultCode)



class test_RecurringBillingTest(apitestbase.ApiTestBase):


createdSubscriptionId = None

def testCreateSubscription(self):

createsubscriptionrequest = apicontractsv1.ARBCreateSubscriptionRequest()
Expand All @@ -53,34 +57,37 @@ def testCreateSubscription(self):
arbcreatesubscriptioncontroller.execute()
response = arbcreatesubscriptioncontroller.getresponse()
self.assertIsNotNone(response.subscriptionId)
self.assertEquals('Ok', response.messages.resultCode)

self.assertEquals('Ok', response.messages.resultCode)
self.__class__.createdSubscriptionId = response.subscriptionId


def testgetsubscription(self):

getSubscription = apicontractsv1.ARBGetSubscriptionRequest()
getSubscription.merchantAuthentication = self.merchantAuthentication
getSubscription.subscriptionId = "3044441" #update valid subscription id
getSubscription.subscriptionId = self.__class__.createdSubscriptionId #update valid subscription id
getSubscriptionController = ARBGetSubscriptionController(getSubscription)
getSubscriptionController.execute()
response = getSubscriptionController.getresponse()
self.assertIsNotNone(response.subscription.name)
self.assertEquals('Ok', response.messages.resultCode)



def testcancelSubscription(self):

cancelsubscriptionrequest = apicontractsv1.ARBCancelSubscriptionRequest()
cancelsubscriptionrequest.merchantAuthentication = self.merchantAuthentication
cancelsubscriptionrequest.refId = 'Sample'
cancelsubscriptionrequest.subscriptionId = '2261331' #input valid subscriptionId
cancelsubscriptionrequest.subscriptionId = self.__class__.createdSubscriptionId #input valid subscriptionId
cancelsubscriptioncontroller = ARBCancelSubscriptionController (cancelsubscriptionrequest)
cancelsubscriptioncontroller.execute()
response = cancelsubscriptioncontroller.getresponse()
self.assertEquals('Ok', response.messages.resultCode)


class paymentTransactionUnitTest(apitestbase.ApiTestBase):

def testauthCaputureTransaction(self):
def testauthCaptureTransaction(self):

transactionrequesttype = apicontractsv1.transactionRequestType()
transactionrequesttype.transactionType = "authCaptureTransaction"
Expand All @@ -101,7 +108,7 @@ def testauthCaputureTransaction(self):
self.assertIsNotNone(response.transactionResponse)
self.assertIsNotNone(response.transactionResponse.transId)
self.assertIsNot("0", response.transactionResponse.transId)

def testauthOnlyContinueTransaction(self):

transactionrequesttype = apicontractsv1.transactionRequestType()
Expand All @@ -121,8 +128,7 @@ def testauthOnlyContinueTransaction(self):
response = createtransactioncontroller.getresponse()
self.assertIsNotNone(response.transactionResponse)
self.assertIsNotNone(response.transactionResponse.transId)

'''
'''
class test_ProductionURL(apitestbase.ApiTestBase):
'' '' ''Tests will run only with production credentials
'' '' ''
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy