braintree_query 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +20 -0
- data/README.rdoc +55 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/lib/braintree_query/errors.rb +4 -0
- data/lib/braintree_query/transaction.rb +80 -0
- data/lib/braintree_query.rb +2 -0
- data/test/helper.rb +7 -0
- data/test/test_braintree_query.rb +356 -0
- metadata +65 -0
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Jeff Jolma
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
= braintree_query
|
2
|
+
|
3
|
+
Client for accessing Braintree Payment Solution's reporting API.
|
4
|
+
|
5
|
+
To see their API: http://dev.braintreepaymentsolutions.com/query/
|
6
|
+
|
7
|
+
Username and password must be passed in to the finder methods (see
|
8
|
+
examples)
|
9
|
+
|
10
|
+
== Example usage
|
11
|
+
|
12
|
+
# find a specific transaction
|
13
|
+
txn = BraintreeQuery::Transaction.find(1177101697, :username => 'testapi', :password => 'password1')
|
14
|
+
txn.condition
|
15
|
+
#=> 'pendingsettlement'
|
16
|
+
|
17
|
+
# find transactions within a time range
|
18
|
+
txns = BraintreeQuery::Transaction.all(:username => 'testapi',
|
19
|
+
:password => 'password1',
|
20
|
+
:start_date => ['2010', '01', '20', '15', '00'].join,
|
21
|
+
:end_date => ['2010', '01', '20', '15', '18'].join)
|
22
|
+
txns.size
|
23
|
+
#=> 3
|
24
|
+
txns.map(&:condition)
|
25
|
+
#=> ["pending", "pending", "pendingsettlement"]
|
26
|
+
|
27
|
+
# find refunds within a time range
|
28
|
+
txns = BraintreeQuery::Transaction.all(:username => 'testapi',
|
29
|
+
:password => 'password1',
|
30
|
+
:start_date => ['2010', '01', '19', '00'].join,
|
31
|
+
:end_date => ['2010', '01', '19', '12'].join,
|
32
|
+
:action_type => 'refund')
|
33
|
+
txns.map(&:transaction_id)
|
34
|
+
#=> ["1176565207", "1176565239"]
|
35
|
+
|
36
|
+
txns.map(&:original_transaction_id)
|
37
|
+
#=> ["1176565193", "1176565221"]
|
38
|
+
|
39
|
+
== TODO
|
40
|
+
* rdoc
|
41
|
+
* better way to do integration tests (i.e. hitting the real server)
|
42
|
+
|
43
|
+
== Note on Patches/Pull Requests
|
44
|
+
|
45
|
+
* Fork the project.
|
46
|
+
* Make your feature addition or bug fix.
|
47
|
+
* Add tests for it. This is important so I don't break it in a
|
48
|
+
future version unintentionally.
|
49
|
+
* Commit, do not mess with rakefile, version, or history.
|
50
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
51
|
+
* Send me a pull request. Bonus points for topic branches.
|
52
|
+
|
53
|
+
== Copyright
|
54
|
+
|
55
|
+
Copyright (c) 2010 Jeff Jolma. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "braintree_query"
|
8
|
+
gem.summary = "Client for accessing Braintree Payment Solution's reporting API."
|
9
|
+
gem.description = "Access Braintree Transactions and Vault records"
|
10
|
+
gem.email = "jeff@animoto.com"
|
11
|
+
gem.homepage = "http://github.com/jjolma/braintree_query"
|
12
|
+
gem.authors = ["Jeff Jolma"]
|
13
|
+
gem.files = FileList["[A-Z]*", "{bin,generators,lib,test}/**/*", 'lib/jeweler/templates/.gitignore']
|
14
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
15
|
+
end
|
16
|
+
Jeweler::GemcutterTasks.new
|
17
|
+
rescue LoadError
|
18
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
19
|
+
end
|
20
|
+
|
21
|
+
require 'rake/testtask'
|
22
|
+
Rake::TestTask.new(:test) do |test|
|
23
|
+
test.libs << 'lib' << 'test'
|
24
|
+
test.pattern = 'test/**/test_*.rb'
|
25
|
+
test.verbose = true
|
26
|
+
end
|
27
|
+
|
28
|
+
begin
|
29
|
+
require 'rcov/rcovtask'
|
30
|
+
Rcov::RcovTask.new do |test|
|
31
|
+
test.libs << 'test'
|
32
|
+
test.pattern = 'test/**/test_*.rb'
|
33
|
+
test.verbose = true
|
34
|
+
end
|
35
|
+
rescue LoadError
|
36
|
+
task :rcov do
|
37
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
task :test => :check_dependencies
|
42
|
+
|
43
|
+
task :default => :test
|
44
|
+
|
45
|
+
require 'rake/rdoctask'
|
46
|
+
Rake::RDocTask.new do |rdoc|
|
47
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
48
|
+
|
49
|
+
rdoc.rdoc_dir = 'rdoc'
|
50
|
+
rdoc.title = "braintree_query #{version}"
|
51
|
+
rdoc.rdoc_files.include('README*')
|
52
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.0
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'uri'
|
2
|
+
require 'net/https'
|
3
|
+
require 'xmlsimple'
|
4
|
+
require 'ostruct'
|
5
|
+
|
6
|
+
module BraintreeQuery
|
7
|
+
class Transaction < OpenStruct
|
8
|
+
BASE_URL = "https://secure.braintreepaymentgateway.com/api/query.php"
|
9
|
+
class << self
|
10
|
+
def all(options={})
|
11
|
+
find_all options
|
12
|
+
end
|
13
|
+
|
14
|
+
def find(txn_id, options={})
|
15
|
+
find_all(options.merge(:transaction_id => txn_id)).first
|
16
|
+
end
|
17
|
+
|
18
|
+
def find_all(options)
|
19
|
+
query = options.map { |k,v| "#{k}=#{v}" }.join('&')
|
20
|
+
full_url = [BASE_URL, query].join '?'
|
21
|
+
|
22
|
+
uri = URI.parse(full_url)
|
23
|
+
server = Net::HTTP.new uri.host, uri.port
|
24
|
+
server.use_ssl = uri.scheme == 'https'
|
25
|
+
server.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
26
|
+
response = server.post BASE_URL, query
|
27
|
+
response_hash = XmlSimple.xml_in(response.body, { 'NormaliseSpace' => 2 })
|
28
|
+
response_hash = massage(response_hash)
|
29
|
+
|
30
|
+
txns = []
|
31
|
+
if response_hash
|
32
|
+
if err_msg = response_hash['error_response']
|
33
|
+
if err_msg =~ /Invalid Username/
|
34
|
+
raise BraintreeQuery::CredentialError, err_msg
|
35
|
+
else
|
36
|
+
raise BraintreeQuery::Error, err_msg
|
37
|
+
end
|
38
|
+
end
|
39
|
+
txn_hashes = response_hash['transaction']
|
40
|
+
|
41
|
+
# handle the single result scenario
|
42
|
+
if txn_hashes.is_a?(Hash)
|
43
|
+
txn_hashes = [txn_hashes]
|
44
|
+
end
|
45
|
+
txn_hashes.each do |txn_hash|
|
46
|
+
txns << Transaction.new(txn_hash)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
txns
|
50
|
+
end
|
51
|
+
|
52
|
+
# stolen and trimmed from rails' Hash.from_xml
|
53
|
+
def massage(value)
|
54
|
+
case value.class.to_s
|
55
|
+
when 'Hash'
|
56
|
+
if value.size == 0
|
57
|
+
nil
|
58
|
+
else
|
59
|
+
xml_value = value.inject({}) do |h,(k,v)|
|
60
|
+
h[k] = massage(v)
|
61
|
+
h
|
62
|
+
end
|
63
|
+
end
|
64
|
+
when 'Array'
|
65
|
+
value.map! { |i| massage(i) }
|
66
|
+
case value.length
|
67
|
+
when 0 then nil
|
68
|
+
when 1 then value.first
|
69
|
+
else value
|
70
|
+
end
|
71
|
+
when 'String'
|
72
|
+
value
|
73
|
+
else
|
74
|
+
raise "can't massage #{value.class.name} - #{value.inspect}"
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
data/test/helper.rb
ADDED
@@ -0,0 +1,356 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
# TODO add this as a gem requirement (at least for test mode)
|
4
|
+
require 'fakeweb'
|
5
|
+
|
6
|
+
class TestBraintreeQuery < Test::Unit::TestCase
|
7
|
+
def setup
|
8
|
+
# HTTP requests mocked out in respective tests
|
9
|
+
FakeWeb.allow_net_connect = false
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_find_within_unknown_txn_id
|
13
|
+
FakeWeb.register_uri(:post, /.*/, :body => empty_transactions_xml)
|
14
|
+
assert_nil BraintreeQuery::Transaction.find(12345)
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_find
|
18
|
+
FakeWeb.register_uri(:post, /.*/, :body => single_transaction_xml)
|
19
|
+
|
20
|
+
txn_id = 1177101697
|
21
|
+
txn = BraintreeQuery::Transaction.find(123)
|
22
|
+
assert_not_nil txn
|
23
|
+
assert_equal txn_id.to_s, txn.transaction_id
|
24
|
+
assert_equal 'Eric', txn.first_name
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_all
|
28
|
+
FakeWeb.register_uri(:post, /.*/, :body => multiple_transaction_xml)
|
29
|
+
|
30
|
+
txns = BraintreeQuery::Transaction.all
|
31
|
+
assert_not_nil txns
|
32
|
+
assert_equal 2, txns.size
|
33
|
+
assert_equal ['1176380853', '1176380089'].sort, txns.map(&:transaction_id).sort
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_handles_credential_error
|
37
|
+
FakeWeb.register_uri(:post, /.*/, :body => error_xml)
|
38
|
+
assert_raises BraintreeQuery::CredentialError do
|
39
|
+
BraintreeQuery::Transaction.all
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_handles_generic_error
|
44
|
+
FakeWeb.register_uri(:post, /.*/, :body => generic_error_xml)
|
45
|
+
assert_raises BraintreeQuery::Error do
|
46
|
+
BraintreeQuery::Transaction.all
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# TODO handle the 'action' section of a transaction (can have multiple e.g. if refunded)
|
51
|
+
|
52
|
+
# TODO best way to do integration tests that actually hit the server?
|
53
|
+
# def test_integration_find
|
54
|
+
# FakeWeb.allow_net_connect = true
|
55
|
+
# txn_id = 1177101697
|
56
|
+
# txn = BraintreeQuery::Transaction.find(1177101697, :username => 'testapi', :password => 'password1')
|
57
|
+
# assert_equal txn_id.to_s, txn.transaction_id
|
58
|
+
# end
|
59
|
+
#
|
60
|
+
# def test_integration_all_by_date_range
|
61
|
+
# FakeWeb.allow_net_connect = true
|
62
|
+
#
|
63
|
+
# # 15 minute window with three transactions
|
64
|
+
# start = ['2010', '01', '20', '15', '00'].join
|
65
|
+
# finish = ['2010', '01', '20', '15', '18'].join
|
66
|
+
# txns = BraintreeQuery::Transaction.all(:username => 'testapi',
|
67
|
+
# :password => 'password1',
|
68
|
+
# :start_date => start,
|
69
|
+
# :end_date => finish)
|
70
|
+
#
|
71
|
+
# assert_equal 3, txns.size
|
72
|
+
# assert_equal ["1177097583", "1177098339", "1177099345"].sort, txns.map(&:transaction_id).sort
|
73
|
+
# end
|
74
|
+
#
|
75
|
+
# def test_integration_find_refunds
|
76
|
+
# FakeWeb.allow_net_connect = true
|
77
|
+
#
|
78
|
+
# # 12 hour window with two refunds
|
79
|
+
# start = ['2010', '01', '19', '00'].join
|
80
|
+
# finish = ['2010', '01', '19', '12'].join
|
81
|
+
# txns = BraintreeQuery::Transaction.all(:username => 'testapi',
|
82
|
+
# :password => 'password1',
|
83
|
+
# :start_date => start,
|
84
|
+
# :end_date => finish,
|
85
|
+
# :action_type => 'refund')
|
86
|
+
# assert_equal 2, txns.size
|
87
|
+
# assert_equal ["1176565207", "1176565239"].sort, txns.map(&:transaction_id).sort
|
88
|
+
# end
|
89
|
+
|
90
|
+
protected
|
91
|
+
def empty_transactions_xml
|
92
|
+
<<-EOF
|
93
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
94
|
+
<nm_response>
|
95
|
+
</nm_response>
|
96
|
+
EOF
|
97
|
+
end
|
98
|
+
|
99
|
+
def error_xml
|
100
|
+
<<-EOF
|
101
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
102
|
+
<nm_response>
|
103
|
+
<error_response>Invalid Username/Password REFID:201239399</error_response>
|
104
|
+
</nm_response>
|
105
|
+
EOF
|
106
|
+
end
|
107
|
+
|
108
|
+
def generic_error_xml
|
109
|
+
<<-EOF
|
110
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
111
|
+
<nm_response>
|
112
|
+
<error_response>Some error we don't explicitely handle</error_response>
|
113
|
+
</nm_response>
|
114
|
+
EOF
|
115
|
+
end
|
116
|
+
|
117
|
+
def single_transaction_xml
|
118
|
+
<<-EOF
|
119
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
120
|
+
<nm_response>
|
121
|
+
<transaction>
|
122
|
+
<transaction_id>1177101697</transaction_id>
|
123
|
+
<platform_id></platform_id>
|
124
|
+
<transaction_type>cc</transaction_type>
|
125
|
+
<condition>pendingsettlement</condition>
|
126
|
+
<order_id></order_id>
|
127
|
+
<authorization_code>123456</authorization_code>
|
128
|
+
<ponumber></ponumber>
|
129
|
+
<order_description></order_description>
|
130
|
+
<first_name>Eric</first_name>
|
131
|
+
<last_name>Cartman</last_name>
|
132
|
+
<address_1></address_1>
|
133
|
+
<address_2></address_2>
|
134
|
+
<company></company>
|
135
|
+
<city></city>
|
136
|
+
<state></state>
|
137
|
+
<postal_code></postal_code>
|
138
|
+
<country></country>
|
139
|
+
<email></email>
|
140
|
+
<phone></phone>
|
141
|
+
<fax></fax>
|
142
|
+
<cell_phone></cell_phone>
|
143
|
+
<customertaxid></customertaxid>
|
144
|
+
<customerid>906770526</customerid>
|
145
|
+
<website></website>
|
146
|
+
<shipping_first_name></shipping_first_name>
|
147
|
+
<shipping_last_name></shipping_last_name>
|
148
|
+
<shipping_address_1></shipping_address_1>
|
149
|
+
<shipping_address_2></shipping_address_2>
|
150
|
+
<shipping_company></shipping_company>
|
151
|
+
<shipping_city></shipping_city>
|
152
|
+
<shipping_state></shipping_state>
|
153
|
+
<shipping_postal_code></shipping_postal_code>
|
154
|
+
<shipping_country></shipping_country>
|
155
|
+
<shipping_email></shipping_email>
|
156
|
+
<shipping_carrier></shipping_carrier>
|
157
|
+
<tracking_number></tracking_number>
|
158
|
+
<shipping_date></shipping_date>
|
159
|
+
<shipping></shipping>
|
160
|
+
<cc_number>4xxxxxxxxxxx1111</cc_number>
|
161
|
+
<cc_hash>f6c609e195d9d4c185dcc8ca662f0180</cc_hash>
|
162
|
+
<cc_exp>0614</cc_exp>
|
163
|
+
<cavv></cavv>
|
164
|
+
<cavv_result></cavv_result>
|
165
|
+
<xid></xid>
|
166
|
+
<avs_response></avs_response>
|
167
|
+
<csc_response></csc_response>
|
168
|
+
<cardholder_auth></cardholder_auth>
|
169
|
+
<check_account></check_account>
|
170
|
+
<check_hash></check_hash>
|
171
|
+
<check_aba></check_aba>
|
172
|
+
<check_name></check_name>
|
173
|
+
<account_holder_type></account_holder_type>
|
174
|
+
<account_type></account_type>
|
175
|
+
<sec_code></sec_code>
|
176
|
+
<processor_id>ccprocessora</processor_id>
|
177
|
+
<tax>0.00</tax>
|
178
|
+
<currency>USD</currency>
|
179
|
+
<cc_bin>411111</cc_bin>
|
180
|
+
<action>
|
181
|
+
<amount>100.00</amount>
|
182
|
+
<action_type>sale</action_type>
|
183
|
+
<date>20100120152810</date>
|
184
|
+
<success>1</success>
|
185
|
+
<ip_address>85.50.70.53</ip_address>
|
186
|
+
<source>api</source>
|
187
|
+
<username>testapi</username>
|
188
|
+
<response_text>SUCCESS</response_text>
|
189
|
+
<batch_id>0</batch_id>
|
190
|
+
<processor_batch_id></processor_batch_id>
|
191
|
+
</action>
|
192
|
+
</transaction>
|
193
|
+
</nm_response>
|
194
|
+
EOF
|
195
|
+
end
|
196
|
+
|
197
|
+
def multiple_transaction_xml
|
198
|
+
<<-EOF
|
199
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
200
|
+
<nm_response>
|
201
|
+
<transaction>
|
202
|
+
<transaction_id>1176380089</transaction_id>
|
203
|
+
<platform_id></platform_id>
|
204
|
+
<transaction_type>cc</transaction_type>
|
205
|
+
<condition>pendingsettlement</condition>
|
206
|
+
<order_id></order_id>
|
207
|
+
<authorization_code>123456</authorization_code>
|
208
|
+
<ponumber></ponumber>
|
209
|
+
<order_description></order_description>
|
210
|
+
<first_name></first_name>
|
211
|
+
<last_name></last_name>
|
212
|
+
<address_1></address_1>
|
213
|
+
<address_2></address_2>
|
214
|
+
<company></company>
|
215
|
+
<city></city>
|
216
|
+
<state></state>
|
217
|
+
<postal_code></postal_code>
|
218
|
+
<country></country>
|
219
|
+
<email></email>
|
220
|
+
<phone></phone>
|
221
|
+
<fax></fax>
|
222
|
+
<cell_phone></cell_phone>
|
223
|
+
<customertaxid></customertaxid>
|
224
|
+
<customerid>1641772517</customerid>
|
225
|
+
<website></website>
|
226
|
+
<shipping_first_name></shipping_first_name>
|
227
|
+
<shipping_last_name></shipping_last_name>
|
228
|
+
<shipping_address_1></shipping_address_1>
|
229
|
+
<shipping_address_2></shipping_address_2>
|
230
|
+
<shipping_company></shipping_company>
|
231
|
+
<shipping_city></shipping_city>
|
232
|
+
<shipping_state></shipping_state>
|
233
|
+
<shipping_postal_code></shipping_postal_code>
|
234
|
+
<shipping_country></shipping_country>
|
235
|
+
<shipping_email></shipping_email>
|
236
|
+
<shipping_carrier></shipping_carrier>
|
237
|
+
<tracking_number></tracking_number>
|
238
|
+
<shipping_date></shipping_date>
|
239
|
+
<shipping></shipping>
|
240
|
+
<cc_number>4xxxxxxxxxxx1111</cc_number>
|
241
|
+
<cc_hash>f6c609e195d9d4c185dcc8ca662f0180</cc_hash>
|
242
|
+
<cc_exp>1010</cc_exp>
|
243
|
+
<cavv></cavv>
|
244
|
+
<cavv_result></cavv_result>
|
245
|
+
<xid></xid>
|
246
|
+
<avs_response></avs_response>
|
247
|
+
<csc_response></csc_response>
|
248
|
+
<cardholder_auth></cardholder_auth>
|
249
|
+
<check_account></check_account>
|
250
|
+
<check_hash></check_hash>
|
251
|
+
<check_aba></check_aba>
|
252
|
+
<check_name></check_name>
|
253
|
+
<account_holder_type></account_holder_type>
|
254
|
+
<account_type></account_type>
|
255
|
+
<sec_code></sec_code>
|
256
|
+
<processor_id>ccprocessora</processor_id>
|
257
|
+
<tax>0.00</tax>
|
258
|
+
<currency>USD</currency>
|
259
|
+
<cc_bin>411111</cc_bin>
|
260
|
+
<action>
|
261
|
+
<amount>1476.00</amount>
|
262
|
+
<action_type>sale</action_type>
|
263
|
+
<date>20100118171150</date>
|
264
|
+
<success>1</success>
|
265
|
+
<ip_address>208.86.238.43</ip_address>
|
266
|
+
<source>api</source>
|
267
|
+
<username>testapi</username>
|
268
|
+
<response_text>SUCCESS</response_text>
|
269
|
+
<batch_id>0</batch_id>
|
270
|
+
<processor_batch_id></processor_batch_id>
|
271
|
+
</action>
|
272
|
+
</transaction>
|
273
|
+
<transaction>
|
274
|
+
<transaction_id>1176380853</transaction_id>
|
275
|
+
<platform_id></platform_id>
|
276
|
+
<transaction_type>cc</transaction_type>
|
277
|
+
<condition>pending</condition>
|
278
|
+
<order_id>b08209bc-0454-11df-b21a-0800270ecde6</order_id>
|
279
|
+
<authorization_code>123456</authorization_code>
|
280
|
+
<ponumber></ponumber>
|
281
|
+
<order_description></order_description>
|
282
|
+
<first_name></first_name>
|
283
|
+
<last_name></last_name>
|
284
|
+
<address_1></address_1>
|
285
|
+
<address_2></address_2>
|
286
|
+
<company></company>
|
287
|
+
<city></city>
|
288
|
+
<state></state>
|
289
|
+
<postal_code>12344</postal_code>
|
290
|
+
<country></country>
|
291
|
+
<email></email>
|
292
|
+
<phone></phone>
|
293
|
+
<fax></fax>
|
294
|
+
<cell_phone></cell_phone>
|
295
|
+
<customertaxid></customertaxid>
|
296
|
+
<customerid>279963267</customerid>
|
297
|
+
<website></website>
|
298
|
+
<shipping_first_name></shipping_first_name>
|
299
|
+
<shipping_last_name></shipping_last_name>
|
300
|
+
<shipping_address_1></shipping_address_1>
|
301
|
+
<shipping_address_2></shipping_address_2>
|
302
|
+
<shipping_company></shipping_company>
|
303
|
+
<shipping_city></shipping_city>
|
304
|
+
<shipping_state></shipping_state>
|
305
|
+
<shipping_postal_code></shipping_postal_code>
|
306
|
+
<shipping_country></shipping_country>
|
307
|
+
<shipping_email></shipping_email>
|
308
|
+
<shipping_carrier></shipping_carrier>
|
309
|
+
<tracking_number></tracking_number>
|
310
|
+
<shipping_date></shipping_date>
|
311
|
+
<shipping></shipping>
|
312
|
+
<cc_number>4xxxxxxxxxxx1111</cc_number>
|
313
|
+
<cc_hash>f6c609e195d9d4c185dcc8ca662f0180</cc_hash>
|
314
|
+
<cc_exp>0621</cc_exp>
|
315
|
+
<cavv></cavv>
|
316
|
+
<cavv_result></cavv_result>
|
317
|
+
<xid></xid>
|
318
|
+
<avs_response>N</avs_response>
|
319
|
+
<csc_response>M</csc_response>
|
320
|
+
<cardholder_auth></cardholder_auth>
|
321
|
+
<check_account></check_account>
|
322
|
+
<check_hash></check_hash>
|
323
|
+
<check_aba></check_aba>
|
324
|
+
<check_name></check_name>
|
325
|
+
<account_holder_type></account_holder_type>
|
326
|
+
<account_type></account_type>
|
327
|
+
<sec_code></sec_code>
|
328
|
+
<processor_id>ccprocessora</processor_id>
|
329
|
+
<tax>0.00</tax>
|
330
|
+
<currency>USD</currency>
|
331
|
+
<cc_bin>411111</cc_bin>
|
332
|
+
<product>
|
333
|
+
<sku>Pages50</sku>
|
334
|
+
<quantity></quantity>
|
335
|
+
<description></description>
|
336
|
+
<amount></amount>
|
337
|
+
</product>
|
338
|
+
<action>
|
339
|
+
<amount>1.00</amount>
|
340
|
+
<action_type>auth</action_type>
|
341
|
+
<date>20100118171243</date>
|
342
|
+
<success>1</success>
|
343
|
+
<ip_address>74.73.145.54</ip_address>
|
344
|
+
<source>api</source>
|
345
|
+
<username>BraintreeTest</username>
|
346
|
+
<response_text>SUCCESS</response_text>
|
347
|
+
<batch_id>0</batch_id>
|
348
|
+
<processor_batch_id></processor_batch_id>
|
349
|
+
</action>
|
350
|
+
</transaction>
|
351
|
+
</nm_response>
|
352
|
+
EOF
|
353
|
+
end
|
354
|
+
end
|
355
|
+
|
356
|
+
|
metadata
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: braintree_query
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jeff Jolma
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-01-20 00:00:00 -05:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Access Braintree Transactions and Vault records
|
17
|
+
email: jeff@animoto.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- LICENSE
|
24
|
+
- README.rdoc
|
25
|
+
files:
|
26
|
+
- LICENSE
|
27
|
+
- README.rdoc
|
28
|
+
- Rakefile
|
29
|
+
- VERSION
|
30
|
+
- lib/braintree_query.rb
|
31
|
+
- lib/braintree_query/errors.rb
|
32
|
+
- lib/braintree_query/transaction.rb
|
33
|
+
- test/helper.rb
|
34
|
+
- test/test_braintree_query.rb
|
35
|
+
has_rdoc: true
|
36
|
+
homepage: http://github.com/jjolma/braintree_query
|
37
|
+
licenses: []
|
38
|
+
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options:
|
41
|
+
- --charset=UTF-8
|
42
|
+
require_paths:
|
43
|
+
- lib
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: "0"
|
49
|
+
version:
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: "0"
|
55
|
+
version:
|
56
|
+
requirements: []
|
57
|
+
|
58
|
+
rubyforge_project:
|
59
|
+
rubygems_version: 1.3.5
|
60
|
+
signing_key:
|
61
|
+
specification_version: 3
|
62
|
+
summary: Client for accessing Braintree Payment Solution's reporting API.
|
63
|
+
test_files:
|
64
|
+
- test/helper.rb
|
65
|
+
- test/test_braintree_query.rb
|