Skip to content
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

PR1992_GetAUJobDetails_sample_code_modifications_python #45

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 16 additions & 9 deletions TransactionReporting/get-account-updater-job-details.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def get_account_updater_job_details():
if response.messages.resultCode == apicontractsv1.messageTypeEnum.Ok:

if hasattr(response, 'auDetails'):
print('SUCCESS: Get Account Updater job details for Month :' + request.month)
print('SUCCESS: Get Account Updater job details for Month:' + request.month)
if response.messages is not None:
print('Message Code: %s' % response.messages.message[0]['code'].text)
print('Message Text: %s' % response.messages.message[0]['text'].text)
Expand All @@ -37,8 +37,8 @@ def get_account_updater_job_details():
for details in response.auDetails.auDelete:
print('Deleted Profile:')
# auDelete Start
print('Customer Profile ID: %s' % details.customerProfileID)
print('Customer Payment Profile ID: %s' % details.customerPaymentProfileID)
print('Customer Profile ID: %s' % details.customerProfileID)
print('Customer Payment Profile ID: %s' % details.customerPaymentProfileID)
print('First Name: %s' % details.firstName)
print('Last Name: %s' % details.lastName)
print('AU Reason Code: %s' % details.auReasonCode)
Expand All @@ -49,16 +49,20 @@ def get_account_updater_job_details():
print('Card Details:')
print('Card Number: %s' % details.creditCard.cardNumber)
print('Card Type: %s' % details.creditCard.cardType)
print('Expiration Date: %s' % details.creditCard.expirationDate)
print('Expiration Date: %s' % details.creditCard.expirationDate)
# fetching deleted subscriptions
if hasattr(details.subscriptionIdList, 'subscriptionId') == True:
print(' ')
print('Subscription Id: %s' % details.subscriptionIdList.subscriptionId)
# auDelete End
print('\n')

for details in response.auDetails.auUpdate:

# auUpdate Start
print('Updated Profile:')
print('Customer Profile ID: %s' % details.customerProfileID)
print('Customer Payment Profile ID: %s' % details.customerPaymentProfileID)
print('Customer Profile ID: %s' % details.customerProfileID)
print('Customer Payment Profile ID: %s' % details.customerPaymentProfileID)
print('First Name: %s' % details.firstName)
print('Last Name: %s' % details.lastName)
print('AU Reason Code: %s' % details.auReasonCode)
Expand All @@ -73,15 +77,18 @@ def get_account_updater_job_details():
print('Old Card details:')
print('new Card Number: %s' % details.newCreditCard.cardNumber)
print('new Card Type: %s' % details.newCreditCard.cardType)
print('new Expiration Date: %s' % details.newCreditCard.expirationDate)
print('new Expiration Date: %s' % details.newCreditCard.expirationDate)
# fetching updated Subscription
if hasattr(details.subscriptionIdList, 'subscriptionId') == True:
print('Subscription Id: %s' % details.subscriptionIdList.subscriptionId)

else:
print('Failed to get Get Account Updater job details for Month :' + request.month)
print('Failed to get Get Account Updater job details for Month:' + request.month)
print('Message Code: %s' % response.messages.message[0]['code'].text)
print('Message Text: %s' % response.messages.message[0]['text'].text)

else:
print('Failed to get Get Account Updater job details for Month :' + request.month)
print('Failed to get Get Account Updater job details for Month and year :' + request.month)
print('Message Code: %s' % response.messages.message[0]['code'].text)
print('Message Text: %s' % response.messages.message[0]['text'].text)
else:
Expand Down
5 changes: 2 additions & 3 deletions test-runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,13 +602,12 @@ def update_held_transaction(self):
print("update_held_transaction")
modl = imp.load_source('modulename', 'PaymentTransactions/update-held-transaction.py')
return modl.update_held_transaction("12345")
# added new method
def get_account_updater_job_details(self):
print("get_account_updater_job_details")

modl = imp.load_source('modulename', 'TransactionReporting/get-account-updater-job-details.py')
return modl.get_account_updater_job_details()

def validate_response(self, response):
if(response is None):
return False
Expand Down