Skip to content

Commit c3f4ee9

Browse files
committed
PR1992_getaujobdetails_sample code_python
Added new class GetAccountUpdaterJobDetails.
1 parent 7d1a18c commit c3f4ee9

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import os
2+
import sys
3+
from authorizenet import apicontractsv1
4+
from authorizenet.apicontrollers import getAUJobDetailsController
5+
from authorizenet.constants import constants
6+
7+
def get_account_updater_job_details():
8+
merchantAuth = apicontractsv1.merchantAuthenticationType()
9+
merchantAuth.name = constants.apiLoginId
10+
merchantAuth.transactionKey = constants.transactionKey
11+
12+
paging = apicontractsv1.Paging()
13+
# Paging limit can be up to 1000 for this request
14+
paging.limit = 1000
15+
paging.offset = 2
16+
request = apicontractsv1.getAUJobDetailsRequest()
17+
request.merchantAuthentication = merchantAuth
18+
request.paging = paging
19+
request.month = "2018-08"
20+
request.modifiedTypeFilter = "all"
21+
request.refId = "123456"
22+
controller = getAUJobDetailsController(request)
23+
controller.execute()
24+
response = controller.getresponse()
25+
26+
if response is not None:
27+
if response.messages.resultCode == apicontractsv1.messageTypeEnum.Ok:
28+
29+
if hasattr(response, 'auDetails'):
30+
print('SUCCESS: Get Account Updater job details for Month :' + request.month)
31+
if response.messages is not None:
32+
print('Message Code: %s' % response.messages.message[0]['code'].text)
33+
print('Message Text: %s' % response.messages.message[0]['text'].text)
34+
print('Total Number In Results: %s' % response.totalNumInResultSet)
35+
print('\n')
36+
37+
for details in response.auDetails.auDelete:
38+
print('Deleted Profile:')
39+
# auDelete Start
40+
print('Customer Profile ID: %s' % details.customerProfileID)
41+
print('Customer Payment Profile ID: %s' % details.customerPaymentProfileID)
42+
print('First Name: %s' % details.firstName)
43+
print('Last Name: %s' % details.lastName)
44+
print('AU Reason Code: %s' % details.auReasonCode)
45+
print('Reason Description: %s' % details.reasonDescription)
46+
print('Update Time UTC: %s' % details.updateTimeUTC)
47+
print(' ')
48+
# fetching card details:
49+
print('Card Details:')
50+
print('Card Number: %s' % details.creditCard.cardNumber)
51+
print('Card Type: %s' % details.creditCard.cardType)
52+
print('Expiration Date: %s' % details.creditCard.expirationDate)
53+
# auDelete End
54+
print('\n')
55+
56+
for details in response.auDetails.auUpdate:
57+
58+
# auUpdate Start
59+
print('Updated Profile:')
60+
print('Customer Profile ID: %s' % details.customerProfileID)
61+
print('Customer Payment Profile ID: %s' % details.customerPaymentProfileID)
62+
print('First Name: %s' % details.firstName)
63+
print('Last Name: %s' % details.lastName)
64+
print('AU Reason Code: %s' % details.auReasonCode)
65+
print('Reason Description: %s' % details.reasonDescription)
66+
print('Update Time UTC: %s' % details.updateTimeUTC)
67+
# fetching Old card details:
68+
print('Old Card details:')
69+
print('old Card Number: %s' % details.oldCreditCard.cardNumber)
70+
print('old Card Type: %s' % details.oldCreditCard.cardType)
71+
print('old Expiration Date: %s' % details.oldCreditCard.expirationDate)
72+
# fetching New card details:
73+
print('Old Card details:')
74+
print('new Card Number: %s' % details.newCreditCard.cardNumber)
75+
print('new Card Type: %s' % details.newCreditCard.cardType)
76+
print('new Expiration Date: %s' % details.newCreditCard.expirationDate)
77+
78+
else:
79+
print('Failed to get Get Account Updater job details for Month :' + request.month)
80+
print('Message Code: %s' % response.messages.message[0]['code'].text)
81+
print('Message Text: %s' % response.messages.message[0]['text'].text)
82+
83+
else:
84+
print('Failed to get Get Account Updater job details for Month :' + request.month)
85+
print('Message Code: %s' % response.messages.message[0]['code'].text)
86+
print('Message Text: %s' % response.messages.message[0]['text'].text)
87+
else:
88+
print('No response received')
89+
90+
91+
if(os.path.basename(__file__) == os.path.basename(sys.argv[0])):
92+
get_account_updater_job_details()
93+

test-runner.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,12 @@ def update_held_transaction(self):
602602
print("update_held_transaction")
603603
modl = imp.load_source('modulename', 'PaymentTransactions/update-held-transaction.py')
604604
return modl.update_held_transaction("12345")
605+
# added new method
606+
def get_account_updater_job_details(self):
607+
print("get_account_updater_job_details")
608+
609+
modl = imp.load_source('modulename', 'TransactionReporting/get-account-updater-job-details.py')
610+
return modl.get_account_updater_job_details()
605611

606612
def validate_response(self, response):
607613
if(response is None):

0 commit comments

Comments
 (0)
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