-
Notifications
You must be signed in to change notification settings - Fork 73
PR1992_GetAUJobDetails_sample_code_modifications_python #45
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
Open
kapilkumar99
wants to merge
3
commits into
AuthorizeNet:master
Choose a base branch
from
kapilkumar99:PR1992_GetAUJobDetails_sample_code_changes_python
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
100 changes: 100 additions & 0 deletions
100
TransactionReporting/get-account-updater-job-details.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| import os | ||
| import sys | ||
| from authorizenet import apicontractsv1 | ||
| from authorizenet.apicontrollers import getAUJobDetailsController | ||
| from authorizenet.constants import constants | ||
|
|
||
| def get_account_updater_job_details(): | ||
| merchantAuth = apicontractsv1.merchantAuthenticationType() | ||
| merchantAuth.name = constants.apiLoginId | ||
| merchantAuth.transactionKey = constants.transactionKey | ||
|
|
||
| paging = apicontractsv1.Paging() | ||
| # Paging limit can be up to 1000 for this request | ||
| paging.limit = 1000 | ||
| paging.offset = 2 | ||
| request = apicontractsv1.getAUJobDetailsRequest() | ||
| request.merchantAuthentication = merchantAuth | ||
| request.paging = paging | ||
| request.month = "2018-08" | ||
| request.modifiedTypeFilter = "all" | ||
| request.refId = "123456" | ||
| controller = getAUJobDetailsController(request) | ||
| controller.execute() | ||
| response = controller.getresponse() | ||
|
|
||
| if response is not None: | ||
| if response.messages.resultCode == apicontractsv1.messageTypeEnum.Ok: | ||
|
|
||
| if hasattr(response, 'auDetails'): | ||
| print('SUCCESS: Get Account Updater job details for Month and year :' + 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) | ||
| print('Total Number In Results: %s' % response.totalNumInResultSet) | ||
| print('\n') | ||
|
|
||
| for details in response.auDetails.auDelete: | ||
| print('Deleted Profile:') | ||
| # auDelete Start | ||
| print('Customer Payment Profile ID: %s' % details.customerPaymentProfileID) | ||
| print('Customer Profile ID: %s' % details.customerProfileID) | ||
gnongsie marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| print('First Name: %s' % details.firstName) | ||
| print('Last Name: %s' % details.lastName) | ||
| print('AU Reason Code: %s' % details.auReasonCode) | ||
| print('Reason Description: %s' % details.reasonDescription) | ||
| print('Update Time UTC: %s' % details.updateTimeUTC) | ||
| print(' ') | ||
| # fetching card 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) | ||
| # 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 Payment Profile ID: %s' % details.customerPaymentProfileID) | ||
| print('Customer Profile ID: %s' % details.customerProfileID) | ||
gnongsie marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| print('First Name: %s' % details.firstName) | ||
| print('Last Name: %s' % details.lastName) | ||
| print('AU Reason Code: %s' % details.auReasonCode) | ||
| print('Reason Description: %s' % details.reasonDescription) | ||
| print('Update Time UTC: %s' % details.updateTimeUTC) | ||
| # fetching Old card details: | ||
| print('Old Card details:') | ||
| print('old Card Number: %s' % details.oldCreditCard.cardNumber) | ||
| print('old Card Type: %s' % details.oldCreditCard.cardType) | ||
| print('old Expiration Date: %s' % details.oldCreditCard.expirationDate) | ||
| # fetching New card 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) | ||
| # 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 and year :' + request.month) | ||
gnongsie marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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 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: | ||
| print('No response received') | ||
|
|
||
|
|
||
| if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): | ||
| get_account_updater_job_details() | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.