4
4
@author: krgupta
5
5
'''
6
6
from authorizenet import apicontractsv1
7
+ from authorizenet import constants
7
8
from decimal import *
8
9
from authorizenet .apicontractsv1 import CTD_ANON
9
10
#from controller.CreateTransactionController import CreateTransactionController
20
21
from authorizenet .apicontrollers import *
21
22
import test
22
23
from authorizenet import utility
24
+ from authorizenet .apicontrollersbase import APIOperationBase
23
25
24
26
class test_ReadProperty (apitestbase .ApiTestBase ):
25
27
def testPropertyFromFile (self ):
26
28
login = utility .helper .getproperty ("api_login_id" )
27
29
transactionkey = utility .helper .getproperty ("transaction_key" )
28
30
self .assertIsNotNone (login )
29
31
self .assertIsNotNone (transactionkey )
30
-
32
+
31
33
class test_TransactionReportingUnitTest (apitestbase .ApiTestBase ):
32
-
33
34
def testGetTransactionDetails (self ):
34
35
35
36
gettransactiondetailsrequest = apicontractsv1 .getTransactionDetailsRequest ()
@@ -38,8 +39,8 @@ def testGetTransactionDetails(self):
38
39
gettransactiondetailscontroller = getTransactionDetailsController (gettransactiondetailsrequest )
39
40
gettransactiondetailscontroller .execute ()
40
41
response = gettransactiondetailscontroller .getresponse ()
41
- self .assertEquals ('Ok' , response .messages .resultCode )
42
-
42
+ self .assertEquals ('Ok' , response .messages .resultCode )
43
+
43
44
class test_RecurringBillingTest (apitestbase .ApiTestBase ):
44
45
45
46
def testCreateSubscription (self ):
@@ -120,6 +121,41 @@ def testauthOnlyContinueTransaction(self):
120
121
response = createtransactioncontroller .getresponse ()
121
122
self .assertIsNotNone (response .transactionResponse )
122
123
self .assertIsNotNone (response .transactionResponse .transId )
123
-
124
+
125
+ '''
126
+ class test_ProductionURL(apitestbase.ApiTestBase):
127
+ '' '' ''Tests will run only with production credentials
128
+ '' '' ''
129
+
130
+ def testGetSettledBatchList(self):
131
+ settledBatchListRequest = apicontractsv1.getSettledBatchListRequest()
132
+ settledBatchListRequest.merchantAuthentication = self.merchantAuthentication
133
+ settledBatchListController = getSettledBatchListController(settledBatchListRequest)
134
+ customEndpoint = constants.PRODUCTION
135
+ apicontrollersbase.APIOperationBase.setenvironment(customEndpoint)
136
+ settledBatchListController.execute()
137
+ response = settledBatchListController.getresponse()
138
+ self.assertEquals('Ok', response.messages.resultCode)
139
+
140
+ def testGetListofSubscriptions(self):
141
+ sorting = apicontractsv1.ARBGetSubscriptionListSorting()
142
+ sorting.orderBy = apicontractsv1.ARBGetSubscriptionListOrderFieldEnum.id
143
+ sorting.orderDescending = "false"
144
+ paging = apicontractsv1.Paging()
145
+ paging.limit = 1000
146
+ paging.offset = 1
147
+ GetListofSubscriptionRequest = apicontractsv1.ARBGetSubscriptionListRequest()
148
+ GetListofSubscriptionRequest.merchantAuthentication = self.merchantAuthentication
149
+ GetListofSubscriptionRequest.refId = "Sample"
150
+ GetListofSubscriptionRequest.searchType = apicontractsv1.ARBGetSubscriptionListSearchTypeEnum.subscriptionInactive
151
+ GetListofSubscriptionRequest.sorting = sorting
152
+ GetListofSubscriptionRequest.paging = paging
153
+ arbgetsubscriptionlistcontroller = ARBGetSubscriptionListController(GetListofSubscriptionRequest)
154
+ customEndpoint = constants.PRODUCTION
155
+ apicontrollersbase.APIOperationBase.setenvironment(customEndpoint)
156
+ arbgetsubscriptionlistcontroller.execute()
157
+ response = arbgetsubscriptionlistcontroller.getresponse()
158
+ self.assertEquals('Ok', response.messages.resultCode)
159
+ '''
124
160
if __name__ == '__main__' :
125
161
unittest .main ()
0 commit comments