File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ require 'rubygems'
2+ require 'yaml'
3+ require 'authorizenet'
4+
5+ include AuthorizeNet ::Reporting
6+
7+ config = YAML . load_file ( File . dirname ( __FILE__ ) + "/../credentials.yml" )
8+
9+ transaction = Transaction . new ( config [ 'api_login_id' ] , config [ 'api_transaction_key' ] , :gateway => :sandbox )
10+
11+ #batchId = "4606008"
12+ batchId = "4551107"
13+
14+ response = transaction . get_transaction_list ( batchId )
15+
16+ if response . result_code == "Ok"
17+ transactions = response . transactions
18+ if transactions == nil
19+ puts "#{ response . message_text } "
20+ else
21+ transactions . each do |transaction |
22+ puts "\n Transaction ID : #{ transaction . id } "
23+ puts "Submitted on (Local) : %s " %[transaction.submitted_at.strftime("%m/%d/%Y %I:%M:%S %p")]
24+ puts "Status : #{ transaction . status } "
25+ puts "Settle Amount : %.2f " %[transaction.settle_amount]
26+ end
27+ end
28+ else
29+ puts "Error : Failed to get Transaction List\n "
30+ puts "Error Text : #{ response . message_text } \n "
31+ puts "Error Code : #{ response . message_code } "
32+ end
You can’t perform that action at this time.
0 commit comments