-
Notifications
You must be signed in to change notification settings - Fork 54
PR1992#getaujobdetails.rb #62
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
4
commits into
AuthorizeNet:master
Choose a base branch
from
kapilkumar99:master
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
4 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
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,98 @@ | ||
require 'rubygems' | ||
require 'yaml' | ||
require 'authorizenet' | ||
require 'securerandom' | ||
require 'certified' | ||
|
||
|
||
include AuthorizeNet::API | ||
|
||
|
||
def get_aujob_Details() | ||
config = YAML.load_file(File.dirname(__FILE__) + "/../credentials.yml") | ||
transaction = AuthorizeNet::API::Transaction.new(config['api_login_id'], config['api_transaction_key'], :gateway => :sandbox) | ||
#@month = '2006-11' | ||
modifiedTypeFilter = "all" | ||
refId='123456' | ||
paging = Paging.new | ||
paging.limit = 100 | ||
paging.offset = 1 | ||
# Build the request object | ||
request= GetAUJobDetailsRequest.new | ||
#request = AuthorizeNet::API::GetAUJobDetailsRequest.new | ||
gnongsie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
request.paging = paging | ||
request.month="2018-08" | ||
gnongsie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
request.modifiedTypeFilter=modifiedTypeFilter | ||
request.refId=refId | ||
response = transaction.get_aujob_details(request) | ||
#puts response. | ||
puts response.messages.resultCode | ||
#puts response.totalNumInResultSet | ||
if response != nil | ||
if response.messages.resultCode == MessageTypeEnum::Ok | ||
if response.auDetails == nil | ||
return response; | ||
else | ||
puts response.auDetails | ||
puts "Refrence id is :#{response.refId}" | ||
gnongsie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
puts" message is : " | ||
puts response.messages.messages[0].code | ||
puts response.messages.messages[0].text | ||
gnongsie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
puts " Total number in result set: #{response.totalNumInResultSet}" | ||
update= response.auDetails[0].auUpdate | ||
update.each do|update| | ||
puts "update start" | ||
puts "Customer profile id : #{update.customerProfileID}" | ||
gnongsie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
puts "Customer Payment Profile ID:#{update.customerPaymentProfileID}" | ||
puts "Update Time (UTC): #{update.updateTimeUTC}" | ||
puts "Reason Code:#{update.auReasonCode}" | ||
puts "Reason Description:#{update.reasonDescription}" | ||
subscription=update.subscriptionIdList[0].subscriptionId | ||
if subscription != nil | ||
puts"SubscriptionId list:" | ||
gnongsie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
puts"SubscriptionId :#{subscription[0]}" | ||
end | ||
puts"New card details" | ||
puts "Card Number:#{update.newCreditCard.cardNumber}" | ||
puts "New Expiration Date:#{update.newCreditCard.expirationDate}" | ||
puts "New Card Type: #{update.newCreditCard.cardType}" | ||
puts"Old card details" | ||
puts "Card Number:#{update.oldCreditCard.cardNumber}" | ||
puts "Expiration Date:#{update.oldCreditCard.expirationDate}" | ||
puts "Old Card Type: #{update.oldCreditCard.cardType}" | ||
end | ||
delete= response.auDetails[0].auDelete | ||
delete.each do|delete| | ||
puts "Customer profile id : #{delete.customerProfileID}" | ||
gnongsie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
puts "Customer Payment Profile ID:#{delete.customerPaymentProfileID}" | ||
puts "Update Time (UTC): #{delete.updateTimeUTC}" | ||
puts "Reason Code:#{delete.auReasonCode}" | ||
puts "Reason Description:#{delete.reasonDescription}" | ||
subscription=delete.subscriptionIdList[0].subscriptionId | ||
if subscription != nil | ||
puts"SubscriptionId list:" | ||
gnongsie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
puts"SubscriptionId :#{subscription[0]}" | ||
end | ||
puts"credit card details" | ||
gnongsie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
puts "Card Number:#{delete.creditCard.cardNumber}" | ||
puts " Expiration Date:#{delete.creditCard.expirationDate}" | ||
puts " Card Type: #{delete.creditCard.cardType}" | ||
end | ||
|
||
end | ||
else | ||
puts response.messages.messages[0].code | ||
puts response.messages.messages[0].text | ||
raise "Failed to create transaction result." | ||
gnongsie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
end | ||
else | ||
puts "Response is null" | ||
raise "Failed to create transaction result." | ||
gnongsie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
end | ||
|
||
return response | ||
end | ||
|
||
if __FILE__ == $0 | ||
get_aujob_Details() | ||
end |
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.