25
25
26
26
class test_ReadProperty (apitestbase .ApiTestBase ):
27
27
def testPropertyFromFile (self ):
28
- login = utility .helper .getproperty ("api_login_id " )
29
- transactionkey = utility .helper .getproperty ("transaction_key " )
28
+ login = utility .helper .getproperty ("api.login.id " )
29
+ transactionkey = utility .helper .getproperty ("transaction.key " )
30
30
self .assertIsNotNone (login )
31
31
self .assertIsNotNone (transactionkey )
32
32
33
+
33
34
class test_TransactionReportingUnitTest (apitestbase .ApiTestBase ):
34
35
def testGetTransactionDetails (self ):
35
36
36
37
gettransactiondetailsrequest = apicontractsv1 .getTransactionDetailsRequest ()
37
38
gettransactiondetailsrequest .merchantAuthentication = self .merchantAuthentication
38
- gettransactiondetailsrequest .transId = '2244574222 ' #update valid transaction id
39
+ gettransactiondetailsrequest .transId = '2252271173 ' #update valid transaction id
39
40
gettransactiondetailscontroller = getTransactionDetailsController (gettransactiondetailsrequest )
40
41
gettransactiondetailscontroller .execute ()
41
42
response = gettransactiondetailscontroller .getresponse ()
42
43
self .assertEquals ('Ok' , response .messages .resultCode )
43
-
44
+
45
+
44
46
class test_RecurringBillingTest (apitestbase .ApiTestBase ):
45
-
47
+
48
+ createdSubscriptionId = None
49
+
46
50
def testCreateSubscription (self ):
47
51
48
52
createsubscriptionrequest = apicontractsv1 .ARBCreateSubscriptionRequest ()
@@ -53,34 +57,37 @@ def testCreateSubscription(self):
53
57
arbcreatesubscriptioncontroller .execute ()
54
58
response = arbcreatesubscriptioncontroller .getresponse ()
55
59
self .assertIsNotNone (response .subscriptionId )
56
- self .assertEquals ('Ok' , response .messages .resultCode )
57
-
60
+ self .assertEquals ('Ok' , response .messages .resultCode )
61
+ self .__class__ .createdSubscriptionId = response .subscriptionId
62
+
63
+
58
64
def testgetsubscription (self ):
59
-
65
+
60
66
getSubscription = apicontractsv1 .ARBGetSubscriptionRequest ()
61
67
getSubscription .merchantAuthentication = self .merchantAuthentication
62
- getSubscription .subscriptionId = "3044441" #update valid subscription id
68
+ getSubscription .subscriptionId = self . __class__ . createdSubscriptionId #update valid subscription id
63
69
getSubscriptionController = ARBGetSubscriptionController (getSubscription )
64
70
getSubscriptionController .execute ()
65
71
response = getSubscriptionController .getresponse ()
66
72
self .assertIsNotNone (response .subscription .name )
67
73
self .assertEquals ('Ok' , response .messages .resultCode )
68
-
74
+
75
+
69
76
def testcancelSubscription (self ):
70
77
71
78
cancelsubscriptionrequest = apicontractsv1 .ARBCancelSubscriptionRequest ()
72
79
cancelsubscriptionrequest .merchantAuthentication = self .merchantAuthentication
73
80
cancelsubscriptionrequest .refId = 'Sample'
74
- cancelsubscriptionrequest .subscriptionId = '2261331' #input valid subscriptionId
81
+ cancelsubscriptionrequest .subscriptionId = self . __class__ . createdSubscriptionId #input valid subscriptionId
75
82
cancelsubscriptioncontroller = ARBCancelSubscriptionController (cancelsubscriptionrequest )
76
83
cancelsubscriptioncontroller .execute ()
77
84
response = cancelsubscriptioncontroller .getresponse ()
78
85
self .assertEquals ('Ok' , response .messages .resultCode )
79
-
86
+
80
87
81
88
class paymentTransactionUnitTest (apitestbase .ApiTestBase ):
82
89
83
- def testauthCaputureTransaction (self ):
90
+ def testauthCaptureTransaction (self ):
84
91
85
92
transactionrequesttype = apicontractsv1 .transactionRequestType ()
86
93
transactionrequesttype .transactionType = "authCaptureTransaction"
@@ -101,7 +108,7 @@ def testauthCaputureTransaction(self):
101
108
self .assertIsNotNone (response .transactionResponse )
102
109
self .assertIsNotNone (response .transactionResponse .transId )
103
110
self .assertIsNot ("0" , response .transactionResponse .transId )
104
-
111
+
105
112
def testauthOnlyContinueTransaction (self ):
106
113
107
114
transactionrequesttype = apicontractsv1 .transactionRequestType ()
@@ -121,8 +128,7 @@ def testauthOnlyContinueTransaction(self):
121
128
response = createtransactioncontroller .getresponse ()
122
129
self .assertIsNotNone (response .transactionResponse )
123
130
self .assertIsNotNone (response .transactionResponse .transId )
124
-
125
- '''
131
+ '''
126
132
class test_ProductionURL(apitestbase.ApiTestBase):
127
133
'' '' ''Tests will run only with production credentials
128
134
'' '' ''
0 commit comments