nimbleshop_stripe 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/README.md +35 -0
  2. data/app/assets/images/nimbleshop_stripe/american_express.png +0 -0
  3. data/app/assets/images/nimbleshop_stripe/discover.png +0 -0
  4. data/app/assets/images/nimbleshop_stripe/mastercard.png +0 -0
  5. data/app/assets/images/nimbleshop_stripe/stripe.png +0 -0
  6. data/app/assets/images/nimbleshop_stripe/visa.png +0 -0
  7. data/app/controllers/nimbleshop_stripe/payments_controller.rb +38 -0
  8. data/app/controllers/nimbleshop_stripe/stripes_controller.rb +50 -0
  9. data/app/helpers/nimbleshop_stripe/exposed_helper.rb +26 -0
  10. data/app/models/nimbleshop_stripe/stripe.rb +31 -0
  11. data/app/views/nimbleshop_stripe/payments/_new.html.erb +118 -0
  12. data/app/views/nimbleshop_stripe/payments/_order_show_extra_info.html.erb +4 -0
  13. data/app/views/nimbleshop_stripe/payments/_payment_info_for_buyer.html.erb +6 -0
  14. data/app/views/nimbleshop_stripe/payments/_stripe_instructions.html.erb +47 -0
  15. data/app/views/nimbleshop_stripe/payments/_what_is_cvv.html.erb +25 -0
  16. data/app/views/nimbleshop_stripe/stripes/_edit.html.erb +31 -0
  17. data/app/views/nimbleshop_stripe/stripes/_form.html.erb +68 -0
  18. data/config/routes.rb +4 -0
  19. data/lib/nimbleshop_stripe/engine.rb +17 -0
  20. data/lib/nimbleshop_stripe/gateway.rb +9 -0
  21. data/lib/nimbleshop_stripe/processor.rb +134 -0
  22. data/lib/nimbleshop_stripe/util.rb +32 -0
  23. data/lib/nimbleshop_stripe.rb +8 -0
  24. data/lib/tasks/nimbleshop_stripe_tasks.rake +31 -0
  25. data/test/test_helper.rb +32 -0
  26. data/test/unit/payment_method_test.rb +21 -0
  27. data/test/unit/processor_test.rb +241 -0
  28. data/test/vcr_cassettes/authorize_net/authorize-failure.yml +38 -0
  29. data/test/vcr_cassettes/authorize_net/authorize-success.yml +38 -0
  30. data/test/vcr_cassettes/authorize_net/capture-failure.yml +38 -0
  31. data/test/vcr_cassettes/authorize_net/capture-success.yml +38 -0
  32. data/test/vcr_cassettes/authorize_net/purchase-failure.yml +38 -0
  33. data/test/vcr_cassettes/authorize_net/purchase-success.yml +38 -0
  34. data/test/vcr_cassettes/authorize_net/refund-failure.yml +38 -0
  35. data/test/vcr_cassettes/authorize_net/refund-success.yml +38 -0
  36. data/test/vcr_cassettes/authorize_net/void-authorize.yml +38 -0
  37. data/test/vcr_cassettes/authorize_net/void-failure.yml +38 -0
  38. data/test/vcr_cassettes/authorize_net/void-success.yml +38 -0
  39. metadata +120 -0
@@ -0,0 +1,32 @@
1
+ raise 'do not use this class'
2
+ module NimbleshopAuthorizedotnet
3
+ module Util
4
+ extend self
5
+
6
+ def billing_address(order)
7
+ { address1: order.real_billing_address.address1,
8
+ city: order.real_billing_address.city,
9
+ state: order.real_billing_address.state_name,
10
+ country: order.real_billing_address.country_name,
11
+ zip: order.real_billing_address.zipcode }
12
+ end
13
+
14
+ def shipping_address(order)
15
+ { first_name: order.shipping_address.first_name,
16
+ last_name: order.shipping_address.last_name,
17
+ address1: order.shipping_address.address1,
18
+ city: order.shipping_address.city,
19
+ state: order.shipping_address.state_name,
20
+ country: order.shipping_address.country_name,
21
+ zip: order.shipping_address.zipcode }
22
+ end
23
+
24
+ # In this method am stands for activemerchant
25
+ def am_options(order)
26
+ billing_address = { billing_address: billing_address(order) }
27
+ shipping_address = { shipping_address: shipping_address(order) }
28
+ misc = { order_id: order.number, email: order.email }
29
+ billing_address.merge(shipping_address).merge(misc)
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,8 @@
1
+ require 'nimbleshop_stripe/engine'
2
+ require 'stripe'
3
+
4
+ module NimbleshopStripe
5
+ autoload :Processor, 'nimbleshop_stripe/processor'
6
+ autoload :Gateway, 'nimbleshop_stripe/gateway'
7
+ autoload :Util, 'nimbleshop_stripe/util'
8
+ end
@@ -0,0 +1,31 @@
1
+
2
+ namespace :nimbleshop_stripe do
3
+
4
+ desc 'copies images from engine to main rails application'
5
+ task :copy_images do
6
+ engine_name = 'nimbleshop_stripe'
7
+ origin = File.expand_path('../../app/assets/images', File.dirname(__FILE__))
8
+ destination = Rails.root.join('app', 'assets', 'images', 'engines', engine_name)
9
+ FileUtils.mkdir_p(destination) if !File.exist?(destination)
10
+ Dir[File.join(origin, '**/*')].each { |file| FileUtils.cp(file, File.join(destination) ) unless File.directory?(file) }
11
+ end
12
+
13
+ desc 'load Stripe record'
14
+ task :load_record => :environment do
15
+
16
+ if NimbleshopStripe::Stripe.find_by_permalink('stripe')
17
+ puts "Stripe record already exists"
18
+ else
19
+ NimbleshopStripe::Stripe.create!(
20
+ {
21
+ publishable_key: Nimbleshop.config.stripe.publishable_key,
22
+ secret_key: Nimbleshop.config.stripe.secret_key,
23
+ business_name: 'Nimbleshop LLC',
24
+ name: 'Stripe',
25
+ permalink: 'stripe',
26
+ description: %Q[<p> Stripe is a payment gateway service provider allowing merchants to accept credit card payments. </p>]
27
+ })
28
+ puts "Stripe record was successfuly created"
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,32 @@
1
+ require 'bundler'
2
+ Bundler.setup(:test)
3
+
4
+ ENV["RAILS_ENV"] = "test"
5
+ require File.expand_path("../../../../nimbleshop_core/test/myshop/config/environment.rb", __FILE__)
6
+ require 'rails/test_help'
7
+ require 'active_record/fixtures'
8
+
9
+ require 'factory_girl'
10
+ Dir["#{File.dirname(__FILE__)}/../../../nimbleshop_core/test/factories/**"].each { |f| require File.expand_path(f) }
11
+
12
+ VCR.configure do | c |
13
+ c.ignore_hosts '127.0.0.1', 'localhost'
14
+ c.cassette_library_dir = 'test/vcr_cassettes'
15
+ c.hook_into :webmock # or :fakeweb
16
+ end
17
+
18
+ class ActiveSupport::TestCase
19
+ include FactoryGirl::Syntax::Methods
20
+ self.use_transactional_fixtures = false
21
+ setup do
22
+ DatabaseCleaner.start
23
+ ActiveRecord::Fixtures.create_fixtures("#{File.dirname(__FILE__)}/../../../nimbleshop_core/test/fixtures", ['shops', 'link_groups', 'payment_methods'])
24
+ end
25
+ teardown do
26
+ DatabaseCleaner.clean
27
+ end
28
+
29
+ def playcasette(casette)
30
+ VCR.use_cassette(casette) { yield }
31
+ end
32
+ end
@@ -0,0 +1,21 @@
1
+ require "test_helper"
2
+
3
+ class PaymentMethodAuthorizeNetTest < ActiveSupport::TestCase
4
+
5
+ test "validations" do
6
+ pm = NimbleshopAuthorizedotnet::Authorizedotnet.new(name: 'Authorize.net', description: 'this is description')
7
+ refute pm.valid?
8
+ expected = ["Business name can't be blank", "Login can't be blank", "Transaction key can't be blank"]
9
+ assert_equal expected, pm.errors.full_messages.sort
10
+ end
11
+
12
+ test "should save the record" do
13
+ pm = NimbleshopAuthorizedotnet::Authorizedotnet.new(name: 'Authorize.net', description: 'this is description')
14
+ pm.login_id = 'FWERSDEED093d'
15
+ pm.transaction_key = 'SDFSDFSFSF423433SDFSFSSFSFSF334'
16
+ pm.business_name = 'BigBinary LLC'
17
+ assert pm.save
18
+ assert_match /authorize-net/, pm.permalink
19
+ end
20
+
21
+ end
@@ -0,0 +1,241 @@
1
+ require 'test_helper'
2
+
3
+ module Processor
4
+ class NimbleshopAuthorizeNetAuthorizeTest < ActiveRecord::TestCase
5
+ setup do
6
+ payment_method = NimbleshopAuthorizedotnet::Authorizedotnet.first
7
+ @order = create(:order)
8
+ @order.stubs(:total_amount).returns(100.48)
9
+ @processor = NimbleshopAuthorizedotnet::Processor.new(order: @order, payment_method: payment_method)
10
+ end
11
+
12
+ test 'when authorization succeeds' do
13
+ creditcard = build(:creditcard)
14
+
15
+ playcasette('authorize.net/authorize-success') do
16
+ assert_equal true, @processor.authorize(creditcard: creditcard)
17
+ end
18
+
19
+ @order.reload
20
+
21
+ transaction = @order.payment_transactions.last
22
+ assert_equal 'authorized', transaction.operation
23
+ assert_equal true, transaction.success
24
+ assert_equal NimbleshopAuthorizedotnet::Authorizedotnet.first, @order.payment_method
25
+ assert @order.authorized?
26
+ end
27
+
28
+ test 'authorization fails when credit card number is not entered' do
29
+ creditcard = build(:creditcard, number: nil)
30
+ assert_equal false, @processor.authorize(creditcard: creditcard)
31
+ assert_equal 'Please enter credit card number', @processor.errors.first
32
+
33
+ @order.reload
34
+
35
+ assert_nil @order.payment_method
36
+ assert @order.abandoned?
37
+ end
38
+
39
+ test 'authorization fails with invalid credit card number' do
40
+ creditcard = build(:creditcard, number: 2)
41
+
42
+ playcasette('authorize.net/authorize-failure') do
43
+ assert_equal false, @processor.authorize(creditcard: creditcard)
44
+ assert_equal 'Credit card was declined. Please try again!', @processor.errors.first
45
+ end
46
+
47
+ @order.reload
48
+
49
+ assert_nil @order.payment_method
50
+ assert @order.abandoned?
51
+ end
52
+ end
53
+
54
+ class AuthorizeNetCaptureTest < ActiveRecord::TestCase
55
+ setup do
56
+ payment_method = NimbleshopAuthorizedotnet::Authorizedotnet.first
57
+ @order = create(:order, payment_method: payment_method)
58
+ @order.stubs(:total_amount).returns(100.48)
59
+ @processor = NimbleshopAuthorizedotnet::Processor.new(order: @order, payment_method: payment_method)
60
+ creditcard = build(:creditcard)
61
+
62
+ playcasette('authorize.net/authorize-success') do
63
+ @processor.authorize(creditcard: creditcard)
64
+ end
65
+
66
+ @tsx_id = @order.payment_transactions.last.transaction_gid
67
+ end
68
+
69
+ test 'when capture succeeds' do
70
+ creditcard = build(:creditcard)
71
+
72
+ playcasette('authorize.net/capture-success') do
73
+ assert_equal true, @processor.kapture(transaction_gid: @tsx_id)
74
+ end
75
+
76
+ @order.reload
77
+ transaction = @order.payment_transactions.last
78
+ assert_equal 'captured', transaction.operation
79
+ assert_equal true, transaction.success
80
+ assert @order.purchased?
81
+ end
82
+
83
+ test 'when capture fails' do
84
+ creditcard = build(:creditcard, number: 2)
85
+
86
+ playcasette('authorize.net/capture-failure') do
87
+ assert_equal false, @processor.kapture(transaction_gid: @tsx_id)
88
+ assert_equal 'Capture request failed', @processor.errors.first
89
+ end
90
+
91
+ @order.reload
92
+
93
+ transaction = @order.payment_transactions.last
94
+
95
+ assert_equal false, transaction.success
96
+ assert_equal 'captured', transaction.operation
97
+ assert @order.authorized?
98
+ end
99
+ end
100
+
101
+ class AuthorizeNetRefundTest < ActiveRecord::TestCase
102
+ setup do
103
+ payment_method = NimbleshopAuthorizedotnet::Authorizedotnet.first
104
+ @order = create(:order)
105
+ @order.stubs(:total_amount).returns(100.48)
106
+ @processor = NimbleshopAuthorizedotnet::Processor.new(order: @order, payment_method: payment_method)
107
+ creditcard = build(:creditcard)
108
+
109
+ playcasette('authorize.net/purchase-success') do
110
+ assert_equal true, @processor.purchase(creditcard: creditcard)
111
+ end
112
+
113
+ assert @order.reload.purchased?
114
+
115
+ @transaction = @order.payment_transactions.last
116
+ end
117
+
118
+ test 'when refund succeeds' do
119
+
120
+ playcasette('authorize.net/refund-success') do
121
+ assert_equal true, @processor.refund(transaction_gid: @transaction.transaction_gid,
122
+ card_number: @transaction.metadata[:card_number])
123
+ end
124
+
125
+ @order.reload
126
+ transaction = @order.payment_transactions.last
127
+
128
+ assert_equal 'refunded', transaction.operation
129
+ assert_equal true, transaction.success
130
+ assert_equal NimbleshopAuthorizedotnet::Authorizedotnet.first, @order.payment_method
131
+ assert @order.refunded?
132
+ end
133
+
134
+ test 'when refund fails' do
135
+
136
+ playcasette('authorize.net/refund-failure') do
137
+ assert_equal false, @processor.refund(transaction_gid: @transaction.transaction_gid, card_number: '1234')
138
+ end
139
+
140
+ @order.reload
141
+
142
+ transaction = @order.payment_transactions.last
143
+
144
+ assert_equal 'refunded', transaction.operation
145
+ assert_equal false, transaction.success
146
+ end
147
+ end
148
+
149
+ class AuthorizeNetVoidTest < ActiveRecord::TestCase
150
+ setup do
151
+ payment_method = NimbleshopAuthorizedotnet::Authorizedotnet.first
152
+ @order = create(:order)
153
+ @order.stubs(:total_amount).returns(100.48)
154
+ @processor = NimbleshopAuthorizedotnet::Processor.new(order: @order, payment_method: payment_method)
155
+ creditcard = build(:creditcard)
156
+
157
+ playcasette('authorize.net/authorize-success') do
158
+ assert_equal true, @processor.authorize(creditcard: creditcard)
159
+ end
160
+
161
+ @tsx_id = @order.payment_transactions.last.transaction_gid
162
+ end
163
+
164
+ test 'when capture succeeds' do
165
+ playcasette('authorize.net/void-success') do
166
+ assert_equal true, @processor.void(transaction_gid: @tsx_id)
167
+ end
168
+
169
+ @order.reload
170
+ transaction = @order.payment_transactions.last
171
+
172
+ assert_equal 'voided', transaction.operation
173
+ assert_equal true, transaction.success
174
+ assert_equal NimbleshopAuthorizedotnet::Authorizedotnet.first, @order.payment_method
175
+ assert @order.voided?
176
+ end
177
+
178
+ test 'when capture fails' do
179
+ playcasette('authorize.net/void-failure') do
180
+ assert_equal false, @processor.void(transaction_gid: @tsx_id)
181
+ end
182
+
183
+ @order.reload
184
+
185
+ transaction = @order.payment_transactions.last
186
+
187
+ assert_equal 'voided', transaction.operation
188
+ assert_equal false, transaction.success
189
+ end
190
+ end
191
+
192
+ class AuthorizeNetPurchaseTest < ActiveRecord::TestCase
193
+ setup do
194
+ payment_method = NimbleshopAuthorizedotnet::Authorizedotnet.first
195
+ @order = create(:order)
196
+ @order.stubs(:total_amount).returns(100.48)
197
+ @processor = NimbleshopAuthorizedotnet::Processor.new(order: @order, payment_method: payment_method)
198
+ end
199
+
200
+ test 'when purchase succeeds' do
201
+ creditcard = build(:creditcard)
202
+
203
+ playcasette('authorize.net/purchase-success') do
204
+ assert_equal true, @processor.purchase(creditcard: creditcard)
205
+ end
206
+
207
+ @order.reload
208
+
209
+ transaction = @order.payment_transactions.last
210
+ assert_equal 'purchased', transaction.operation
211
+ assert_equal true, transaction.success
212
+ assert @order.purchased?
213
+ end
214
+
215
+ test 'purchase fails when credit card number is not entered ' do
216
+ creditcard = build(:creditcard, number: nil)
217
+
218
+ playcasette('authorize.net/purchase-failure') do
219
+ assert_equal false, @processor.purchase(creditcard: creditcard)
220
+ assert_equal 'Please enter credit card number', @processor.errors.first
221
+ end
222
+
223
+ assert @order.abandoned?
224
+ end
225
+
226
+ test 'purchase fails when invalid credit card number is entered' do
227
+ creditcard = build(:creditcard, number: 2)
228
+
229
+ playcasette('authorize.net/purchase-failure') do
230
+ assert_equal false, @processor.purchase(creditcard: creditcard)
231
+ assert_equal 'Credit card was declined. Please try again!', @processor.errors.first
232
+ end
233
+
234
+ transaction = @order.payment_transactions.last
235
+
236
+ assert_equal false, transaction.success
237
+ assert_equal 'purchased', transaction.operation
238
+ assert @order.abandoned?
239
+ end
240
+ end
241
+ end
@@ -0,0 +1,38 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test.authorize.net/gateway/transact.dll
6
+ body:
7
+ encoding: US-ASCII
8
+ string: x_version=3.1&x_login=26Daqx7Jtw7R&x_tran_key=66JWf57KKc82W9y6&x_relay_response=FALSE&x_type=AUTH_ONLY&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%24&x_invoice_num=&x_description=&x_card_num=2&x_card_code=123&x_exp_date=0413&x_first_name=Meda&x_last_name=McClure&x_amount=100.48&x_test_request=FALSE
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Connection:
22
+ - close
23
+ Date:
24
+ - Sun, 22 Apr 2012 14:59:28 GMT
25
+ Server:
26
+ - Microsoft-IIS/6.0
27
+ X-Powered-By:
28
+ - ASP.NET
29
+ Content-Type:
30
+ - text/html
31
+ Content-Length:
32
+ - "307"
33
+ body:
34
+ encoding: US-ASCII
35
+ string: $3$,$1$,$6$,$The credit card number is invalid.$,$$,$P$,$0$,$$,$$,$100.48$,$CC$,$auth_only$,$$,$Meda$,$McClure$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$82AF683896C71D9FCD99BE1D5AFFEEA8$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$XXXX2$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$
36
+ http_version:
37
+ recorded_at: Sun, 22 Apr 2012 14:59:28 GMT
38
+ recorded_with: VCR 2.0.0
@@ -0,0 +1,38 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test.authorize.net/gateway/transact.dll
6
+ body:
7
+ encoding: US-ASCII
8
+ string: x_version=3.1&x_login=26Daqx7Jtw7R&x_tran_key=66JWf57KKc82W9y6&x_relay_response=FALSE&x_type=AUTH_ONLY&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%24&x_invoice_num=&x_description=&x_card_num=4007000000027&x_card_code=123&x_exp_date=0413&x_first_name=Clarabelle&x_last_name=Stiedemann&x_amount=100.48&x_test_request=FALSE
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Connection:
22
+ - close
23
+ Date:
24
+ - Sun, 22 Apr 2012 14:59:29 GMT
25
+ Server:
26
+ - Microsoft-IIS/6.0
27
+ X-Powered-By:
28
+ - ASP.NET
29
+ Content-Type:
30
+ - text/html
31
+ Content-Length:
32
+ - "341"
33
+ body:
34
+ encoding: US-ASCII
35
+ string: $1$,$1$,$1$,$This transaction has been approved.$,$FI4KFO$,$Y$,$2171213293$,$$,$$,$100.48$,$CC$,$auth_only$,$$,$Clarabelle$,$Stiedemann$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$C5FD3839F84A696E8F8727D8B387A800$,$P$,$2$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$XXXX0027$,$Visa$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$
36
+ http_version:
37
+ recorded_at: Sun, 22 Apr 2012 14:59:30 GMT
38
+ recorded_with: VCR 2.0.0
@@ -0,0 +1,38 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test.authorize.net/gateway/transact.dll
6
+ body:
7
+ encoding: US-ASCII
8
+ string: x_version=3.1&x_login=26Daqx7Jtw7R&x_tran_key=66JWf57KKc82W9y6&x_relay_response=FALSE&x_type=PRIOR_AUTH_CAPTURE&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%24&x_trans_id=%7B%7D&x_amount=&x_test_request=FALSE
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Connection:
22
+ - close
23
+ Date:
24
+ - Sun, 22 Apr 2012 15:19:50 GMT
25
+ Server:
26
+ - Microsoft-IIS/6.0
27
+ X-Powered-By:
28
+ - ASP.NET
29
+ Content-Type:
30
+ - text/html
31
+ Content-Length:
32
+ - "311"
33
+ body:
34
+ encoding: US-ASCII
35
+ string: $3$,$2$,$33$,$A valid referenced transaction ID is required.$,$$,$P$,$0$,$$,$$,$0.00$,$CC$,$prior_auth_capture$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$E4D08D153C02147DACEF435A63672D69$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$
36
+ http_version:
37
+ recorded_at: Sun, 22 Apr 2012 15:19:50 GMT
38
+ recorded_with: VCR 2.0.0
@@ -0,0 +1,38 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test.authorize.net/gateway/transact.dll
6
+ body:
7
+ encoding: US-ASCII
8
+ string: x_version=3.1&x_login=26Daqx7Jtw7R&x_tran_key=66JWf57KKc82W9y6&x_relay_response=FALSE&x_type=PRIOR_AUTH_CAPTURE&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%24&x_trans_id=2171213293&x_amount=100.48&x_test_request=FALSE
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Connection:
22
+ - close
23
+ Date:
24
+ - Sun, 22 Apr 2012 14:59:32 GMT
25
+ Server:
26
+ - Microsoft-IIS/6.0
27
+ X-Powered-By:
28
+ - ASP.NET
29
+ Content-Type:
30
+ - text/html
31
+ Content-Length:
32
+ - "315"
33
+ body:
34
+ encoding: US-ASCII
35
+ string: $1$,$1$,$311$,$This transaction has already been captured.$,$$,$P$,$0$,$$,$$,$100.48$,$CC$,$prior_auth_capture$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$82AF683896C71D9FCD99BE1D5AFFEEA8$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$Visa$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$
36
+ http_version:
37
+ recorded_at: Sun, 22 Apr 2012 14:59:33 GMT
38
+ recorded_with: VCR 2.0.0
@@ -0,0 +1,38 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test.authorize.net/gateway/transact.dll
6
+ body:
7
+ encoding: US-ASCII
8
+ string: x_version=3.1&x_login=26Daqx7Jtw7R&x_tran_key=66JWf57KKc82W9y6&x_relay_response=FALSE&x_type=AUTH_CAPTURE&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%24&x_invoice_num=&x_description=&x_card_num=2&x_card_code=123&x_exp_date=0413&x_first_name=Nova&x_last_name=Weimann&x_amount=100.48&x_test_request=FALSE
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Connection:
22
+ - close
23
+ Date:
24
+ - Sun, 22 Apr 2012 14:59:34 GMT
25
+ Server:
26
+ - Microsoft-IIS/6.0
27
+ X-Powered-By:
28
+ - ASP.NET
29
+ Content-Type:
30
+ - text/html
31
+ Content-Length:
32
+ - "310"
33
+ body:
34
+ encoding: US-ASCII
35
+ string: $3$,$1$,$6$,$The credit card number is invalid.$,$$,$P$,$0$,$$,$$,$100.48$,$CC$,$auth_capture$,$$,$Nova$,$Weimann$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$82AF683896C71D9FCD99BE1D5AFFEEA8$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$XXXX2$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$
36
+ http_version:
37
+ recorded_at: Sun, 22 Apr 2012 14:59:34 GMT
38
+ recorded_with: VCR 2.0.0
@@ -0,0 +1,38 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test.authorize.net/gateway/transact.dll
6
+ body:
7
+ encoding: US-ASCII
8
+ string: x_version=3.1&x_login=26Daqx7Jtw7R&x_tran_key=66JWf57KKc82W9y6&x_relay_response=FALSE&x_type=AUTH_CAPTURE&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%24&x_invoice_num=&x_description=&x_card_num=4007000000027&x_card_code=123&x_exp_date=0413&x_first_name=Elias&x_last_name=Goldner&x_amount=100.48&x_test_request=FALSE
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Connection:
22
+ - close
23
+ Date:
24
+ - Sun, 22 Apr 2012 14:59:35 GMT
25
+ Server:
26
+ - Microsoft-IIS/6.0
27
+ X-Powered-By:
28
+ - ASP.NET
29
+ Content-Type:
30
+ - text/html
31
+ Content-Length:
32
+ - "336"
33
+ body:
34
+ encoding: US-ASCII
35
+ string: $1$,$1$,$1$,$This transaction has been approved.$,$8XZB16$,$Y$,$2171213294$,$$,$$,$100.48$,$CC$,$auth_capture$,$$,$Elias$,$Goldner$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$B49F0B0B6E4EDB37B26F2618E8E3780A$,$P$,$2$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$XXXX0027$,$Visa$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$
36
+ http_version:
37
+ recorded_at: Sun, 22 Apr 2012 14:59:36 GMT
38
+ recorded_with: VCR 2.0.0
@@ -0,0 +1,38 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test.authorize.net/gateway/transact.dll
6
+ body:
7
+ encoding: US-ASCII
8
+ string: x_version=3.1&x_login=26Daqx7Jtw7R&x_tran_key=66JWf57KKc82W9y6&x_relay_response=FALSE&x_type=CREDIT&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%24&x_trans_id=2171213294&x_card_num=1234&x_invoice_num=&x_description=&x_amount=100.48&x_test_request=FALSE
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Connection:
22
+ - close
23
+ Date:
24
+ - Wed, 02 May 2012 19:52:39 GMT
25
+ Server:
26
+ - Microsoft-IIS/6.0
27
+ X-Powered-By:
28
+ - ASP.NET
29
+ Content-Type:
30
+ - text/html
31
+ Content-Length:
32
+ - "342"
33
+ body:
34
+ encoding: US-ASCII
35
+ string: $3$,$2$,$54$,$The referenced transaction does not meet the criteria for issuing a credit.$,$$,$P$,$0$,$$,$$,$100.48$,$CC$,$credit$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$82AF683896C71D9FCD99BE1D5AFFEEA8$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$XXXX1234$,$Visa$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$
36
+ http_version:
37
+ recorded_at: Wed, 02 May 2012 19:52:39 GMT
38
+ recorded_with: VCR 2.0.0
@@ -0,0 +1,38 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test.authorize.net/gateway/transact.dll
6
+ body:
7
+ encoding: US-ASCII
8
+ string: x_version=3.1&x_login=26Daqx7Jtw7R&x_tran_key=66JWf57KKc82W9y6&x_relay_response=FALSE&x_type=CREDIT&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%24&x_trans_id=2171213294&x_card_num=XXXX-XXXX-XXXX-0027&x_invoice_num=&x_description=&x_amount=100.48&x_test_request=FALSE
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Connection:
22
+ - close
23
+ Date:
24
+ - Wed, 02 May 2012 19:50:48 GMT
25
+ Server:
26
+ - Microsoft-IIS/6.0
27
+ X-Powered-By:
28
+ - ASP.NET
29
+ Content-Type:
30
+ - text/html
31
+ Content-Length:
32
+ - "310"
33
+ body:
34
+ encoding: US-ASCII
35
+ string: $1$,$1$,$1$,$This transaction has been approved.$,$$,$P$,$2171555499$,$$,$$,$100.48$,$CC$,$credit$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$DFF17287B2348D649D6F98C83DDA88CC$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$XXXX0027$,$Visa$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$,$$
36
+ http_version:
37
+ recorded_at: Wed, 02 May 2012 19:50:48 GMT
38
+ recorded_with: VCR 2.0.0