Skip to content

Commit 2fef4a1

Browse files
committed
change name to match entry in API Reference Guide
1 parent 755bcf3 commit 2fef4a1

4 files changed

Lines changed: 55 additions & 52 deletions

File tree

RecurringBilling/get-list-of-subscription.py

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
"""http://developer.authorize.net/api/reference/#recurring-billing-get-a-list-of-subscriptions"""
2+
import os
3+
import sys
4+
import imp
5+
6+
from authorizenet import apicontractsv1
7+
from authorizenet.apicontrollers import ARBGetSubscriptionListController
8+
constants = imp.load_source('modulename', 'constants.py')
9+
10+
def get_list_of_subscriptions():
11+
"""get list of subscriptions"""
12+
merchantAuth = apicontractsv1.merchantAuthenticationType()
13+
merchantAuth.name = constants.apiLoginId
14+
merchantAuth.transactionKey = constants.transactionKey
15+
16+
sorting = apicontractsv1.ARBGetSubscriptionListSorting()
17+
sorting.orderBy = apicontractsv1.ARBGetSubscriptionListOrderFieldEnum.id
18+
sorting.orderDescending = "false"
19+
20+
paging = apicontractsv1.Paging()
21+
paging.limit = 100
22+
paging.offset = 1
23+
24+
request = apicontractsv1.ARBGetSubscriptionListRequest()
25+
request.merchantAuthentication = merchantAuth
26+
request.refId = "Sample"
27+
request.searchType = apicontractsv1.ARBGetSubscriptionListSearchTypeEnum.subscriptionInactive
28+
request.sorting = sorting
29+
request.paging = paging
30+
31+
controller = ARBGetSubscriptionListController(request)
32+
controller.execute()
33+
34+
response = controller.getresponse()
35+
36+
if response.messages.resultCode == "Ok":
37+
print "SUCCESS"
38+
print "Message Code : %s" % response.messages.message[0]['code'].text
39+
print "Message text : %s" % response.messages.message[0]['text'].text
40+
print "Total Number In Results : %s" % response.totalNumInResultSet
41+
else:
42+
print "ERROR"
43+
print "Message Code : %s" % response.messages.message[0]['code'].text
44+
print "Message text : %s" % response.messages.message[0]['text'].text
45+
46+
return response
47+
48+
if os.path.basename(__file__) == os.path.basename(sys.argv[0]):
49+
get_list_of_subscriptions()

list_of_sample_codes.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SampleCode IsDependent RunApi
1+
SampleCode IsDependent RunApi
22
create_an_apple_pay_transaction 1 0
33
create_an_accept_transaction 1 0
44
create_an_android_pay_transaction 1 0
@@ -39,7 +39,7 @@ void 1 0
3939
cancel_subscription 1 0
4040
create_subscription 1 1
4141
create_subscription_from_customer_profile 1 1
42-
get_list_of_subscription 1 1
42+
get_list_of_subscriptions 1 1
4343
get_subscription_status 1 0
4444
get_subscription 1 1
4545
update_subscription 1 1

test-runner.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -494,11 +494,11 @@ def create_subscription_from_customer_profile(self):
494494

495495
return response
496496

497-
def get_list_of_subscription(self):
498-
print("get_list_of_subscription")
497+
def get_list_of_subscriptions(self):
498+
print("get_list_of_subscriptions")
499499

500-
modl = imp.load_source('modulename', 'RecurringBilling/get-list-of-subscription.py')
501-
return modl.get_list_of_subscription()
500+
modl = imp.load_source('modulename', 'RecurringBilling/get-list-of-subscriptions.py')
501+
return modl.get_list_of_subscriptions()
502502

503503
def get_subscription_status(self):
504504
print("get_subscription_status")

0 commit comments

Comments
 (0)