activemerchant 1.3.2 → 1.4.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.
Files changed (85) hide show
  1. data.tar.gz.sig +0 -0
  2. data/CHANGELOG +58 -0
  3. data/CONTRIBUTERS +25 -0
  4. data/MIT-LICENSE +3 -3
  5. data/README +16 -10
  6. data/Rakefile +4 -3
  7. data/lib/active_merchant.rb +7 -1
  8. data/lib/active_merchant/billing/check.rb +16 -9
  9. data/lib/active_merchant/billing/gateway.rb +1 -1
  10. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +702 -0
  11. data/lib/active_merchant/billing/gateways/beanstream.rb +102 -0
  12. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +233 -0
  13. data/lib/active_merchant/billing/gateways/beanstream_interac.rb +54 -0
  14. data/lib/active_merchant/billing/gateways/braintree.rb +10 -1
  15. data/lib/active_merchant/billing/gateways/cyber_source.rb +26 -2
  16. data/lib/active_merchant/billing/gateways/data_cash.rb +255 -59
  17. data/lib/active_merchant/billing/gateways/modern_payments.rb +36 -0
  18. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +214 -0
  19. data/lib/active_merchant/billing/gateways/net_registry.rb +1 -0
  20. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +2 -2
  21. data/lib/active_merchant/billing/gateways/payflow_express.rb +3 -11
  22. data/lib/active_merchant/billing/gateways/payment_express.rb +2 -2
  23. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +39 -21
  24. data/lib/active_merchant/billing/gateways/paypal_ca.rb +13 -0
  25. data/lib/active_merchant/billing/gateways/paypal_express.rb +3 -12
  26. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +20 -0
  27. data/lib/active_merchant/billing/gateways/protx.rb +25 -25
  28. data/lib/active_merchant/billing/gateways/sage.rb +145 -0
  29. data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +88 -0
  30. data/lib/active_merchant/billing/gateways/sage/sage_core.rb +110 -0
  31. data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +97 -0
  32. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +3 -1
  33. data/lib/active_merchant/billing/gateways/skip_jack.rb +2 -0
  34. data/lib/active_merchant/billing/gateways/trust_commerce.rb +1 -1
  35. data/lib/active_merchant/billing/gateways/wirecard.rb +304 -0
  36. data/lib/active_merchant/billing/integrations.rb +8 -2
  37. data/lib/active_merchant/billing/integrations/action_view_helper.rb +18 -4
  38. data/lib/active_merchant/billing/integrations/hi_trust/notification.rb +4 -2
  39. data/lib/active_merchant/billing/integrations/notification.rb +10 -1
  40. data/lib/active_merchant/lib/posts_data.rb +12 -3
  41. data/script/destroy +0 -0
  42. data/script/generate +0 -0
  43. data/test/extra/binding_of_caller.rb +0 -0
  44. data/test/extra/breakpoint.rb +0 -0
  45. data/test/fixtures.yml +24 -0
  46. data/test/remote/gateways/remote_authorize_net_cim_test.rb +459 -0
  47. data/test/remote/gateways/remote_beanstream_interac_test.rb +53 -0
  48. data/test/remote/gateways/remote_beanstream_test.rb +150 -0
  49. data/test/remote/gateways/remote_braintree_test.rb +22 -0
  50. data/test/remote/gateways/remote_cyber_source_test.rb +28 -3
  51. data/test/remote/gateways/remote_data_cash_test.rb +250 -48
  52. data/test/remote/gateways/remote_modern_payments_cim_test.rb +58 -0
  53. data/test/remote/gateways/remote_modern_payments_test.rb +43 -0
  54. data/test/remote/gateways/remote_sage_bankcard_test.rb +109 -0
  55. data/test/remote/gateways/remote_sage_test.rb +87 -0
  56. data/test/remote/gateways/remote_sage_virtual_check_test.rb +62 -0
  57. data/test/remote/gateways/remote_wirecard_test.rb +76 -0
  58. data/test/remote/integrations/remote_paypal_integration_test.rb +15 -3
  59. data/test/test_helper.rb +31 -13
  60. data/test/unit/check_test.rb +14 -2
  61. data/test/unit/credit_card_methods_test.rb +18 -0
  62. data/test/unit/gateways/authorize_net_cim_test.rb +641 -0
  63. data/test/unit/gateways/beanstream_interac_test.rb +51 -0
  64. data/test/unit/gateways/beanstream_test.rb +108 -0
  65. data/test/unit/gateways/braintree_test.rb +2 -5
  66. data/test/unit/gateways/cyber_source_test.rb +18 -0
  67. data/test/unit/gateways/data_cash_test.rb +32 -4
  68. data/test/unit/gateways/gateway_test.rb +8 -1
  69. data/test/unit/gateways/modern_payments_cim_test.rb +171 -0
  70. data/test/unit/gateways/net_registry_test.rb +6 -0
  71. data/test/unit/gateways/payflow_express_test.rb +18 -2
  72. data/test/unit/gateways/paypal_express_test.rb +154 -0
  73. data/test/unit/gateways/paypal_test.rb +140 -0
  74. data/test/unit/gateways/sage_bankcard_test.rb +162 -0
  75. data/test/unit/gateways/sage_virtual_check_test.rb +71 -0
  76. data/test/unit/gateways/secure_pay_au_test.rb +58 -1
  77. data/test/unit/gateways/skip_jack_test.rb +8 -0
  78. data/test/unit/gateways/verifi_test.rb +0 -1
  79. data/test/unit/gateways/wirecard_test.rb +232 -0
  80. data/test/unit/integrations/action_view_helper_test.rb +3 -0
  81. data/test/unit/integrations/notifications/hi_trust_notification_test.rb +23 -2
  82. data/test/unit/integrations/notifications/notification_test.rb +13 -0
  83. data/test/unit/posts_data_test.rb +20 -6
  84. metadata +40 -5
  85. metadata.gz.sig +0 -0
@@ -30,6 +30,19 @@ class NotificationTest < Test::Unit::TestCase
30
30
  assert_equal 'clicked', notification.params['checkout.x']
31
31
  end
32
32
 
33
+ def test_valid_sender_always_true_in_testmode
34
+ assert_equal ActiveMerchant::Billing::Base.integration_mode, :test
35
+ assert @notification.valid_sender?(nil)
36
+ assert @notification.valid_sender?('localhost')
37
+ end
38
+
39
+ def test_valid_sender_always_true_when_no_ips
40
+ ActiveMerchant::Billing::Base.integration_mode = :production
41
+ assert @notification.valid_sender?(nil)
42
+ assert @notification.valid_sender?('localhost')
43
+ ActiveMerchant::Billing::Base.integration_mode = :test
44
+ end
45
+
33
46
  private
34
47
  def http_raw_data
35
48
  "mc_gross=500.00&address_status=confirmed&payer_id=EVMXCLDZJV77Q&tax=0.00&address_street=164+Waverley+Street&payment_date=15%3A23%3A54+Apr+15%2C+2005+PDT&payment_status=Completed&address_zip=K2P0V6&first_name=Tobias&mc_fee=15.05&address_country_code=CA&address_name=Tobias+Luetke&notify_version=1.7&custom=&payer_status=unverified&business=tobi%40leetsoft.com&address_country=Canada&address_city=Ottawa&quantity=1&payer_email=tobi%40snowdevil.ca&verify_sign=AEt48rmhLYtkZ9VzOGAtwL7rTGxUAoLNsuf7UewmX7UGvcyC3wfUmzJP&txn_id=6G996328CK404320L&payment_type=instant&last_name=Luetke&address_state=Ontario&receiver_email=tobi%40leetsoft.com&payment_fee=&receiver_id=UQ8PDYXJZQD9Y&txn_type=web_accept&item_name=Store+Purchase&mc_currency=CAD&item_number=&test_ipn=1&payment_gross=&shipping=0.00"
@@ -1,9 +1,5 @@
1
1
  require File.dirname(__FILE__) + '/../test_helper'
2
2
 
3
- class SimpleGateway
4
- include ActiveMerchant::PostsData
5
- end
6
-
7
3
  class MockResponse
8
4
  def body
9
5
  end
@@ -13,11 +9,11 @@ class PostsDataTests < Test::Unit::TestCase
13
9
  URL = 'http://example.com'
14
10
 
15
11
  def setup
16
- @gateway = SimpleGateway.new
12
+ @gateway = SimpleTestGateway.new
17
13
  end
18
14
 
19
15
  def teardown
20
- SimpleGateway.retry_safe = false
16
+ SimpleTestGateway.retry_safe = false
21
17
  end
22
18
 
23
19
  def test_single_successful_post
@@ -83,4 +79,22 @@ class PostsDataTests < Test::Unit::TestCase
83
79
  @gateway.ssl_post(URL, '')
84
80
  end
85
81
  end
82
+
83
+ def test_setting_ssl_strict_outside_class_definition
84
+ assert_equal SimpleTestGateway.ssl_strict, SubclassGateway.ssl_strict
85
+ SimpleTestGateway.ssl_strict = !SimpleTestGateway.ssl_strict
86
+ assert_equal SimpleTestGateway.ssl_strict, SubclassGateway.ssl_strict
87
+ end
88
+
89
+ def test_setting_timeouts
90
+ @gateway.class.open_timeout=50
91
+ @gateway.class.read_timeout=37
92
+ Net::HTTP.any_instance.expects(:post).once.returns(MockResponse.new)
93
+ Net::HTTP.any_instance.expects(:open_timeout=).with(50)
94
+ Net::HTTP.any_instance.expects(:read_timeout=).with(37)
95
+
96
+ assert_nothing_raised do
97
+ @gateway.ssl_post(URL, '')
98
+ end
99
+ end
86
100
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemerchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke
8
- autorequire: active_merchant
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain:
11
11
  - |
@@ -30,11 +30,12 @@ cert_chain:
30
30
  hPaSTyVU0yCSnw==
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2008-02-24 00:00:00 -05:00
33
+ date: 2008-11-27 00:00:00 -05:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: activesupport
38
+ type: :runtime
38
39
  version_requirement:
39
40
  version_requirements: !ruby/object:Gem::Requirement
40
41
  requirements:
@@ -44,6 +45,7 @@ dependencies:
44
45
  version:
45
46
  - !ruby/object:Gem::Dependency
46
47
  name: builder
48
+ type: :runtime
47
49
  version_requirement:
48
50
  version_requirements: !ruby/object:Gem::Requirement
49
51
  requirements:
@@ -73,6 +75,11 @@ files:
73
75
  - lib/active_merchant/billing/gateway.rb
74
76
  - lib/active_merchant/billing/gateways
75
77
  - lib/active_merchant/billing/gateways/authorize_net.rb
78
+ - lib/active_merchant/billing/gateways/authorize_net_cim.rb
79
+ - lib/active_merchant/billing/gateways/beanstream
80
+ - lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb
81
+ - lib/active_merchant/billing/gateways/beanstream.rb
82
+ - lib/active_merchant/billing/gateways/beanstream_interac.rb
76
83
  - lib/active_merchant/billing/gateways/bogus.rb
77
84
  - lib/active_merchant/billing/gateways/braintree.rb
78
85
  - lib/active_merchant/billing/gateways/card_stream.rb
@@ -82,6 +89,8 @@ files:
82
89
  - lib/active_merchant/billing/gateways/eway.rb
83
90
  - lib/active_merchant/billing/gateways/exact.rb
84
91
  - lib/active_merchant/billing/gateways/linkpoint.rb
92
+ - lib/active_merchant/billing/gateways/modern_payments.rb
93
+ - lib/active_merchant/billing/gateways/modern_payments_cim.rb
85
94
  - lib/active_merchant/billing/gateways/moneris.rb
86
95
  - lib/active_merchant/billing/gateways/net_registry.rb
87
96
  - lib/active_merchant/billing/gateways/netbilling.rb
@@ -100,13 +109,20 @@ files:
100
109
  - lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb
101
110
  - lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb
102
111
  - lib/active_merchant/billing/gateways/paypal.rb
112
+ - lib/active_merchant/billing/gateways/paypal_ca.rb
103
113
  - lib/active_merchant/billing/gateways/paypal_express.rb
114
+ - lib/active_merchant/billing/gateways/paypal_express_common.rb
104
115
  - lib/active_merchant/billing/gateways/plugnpay.rb
105
116
  - lib/active_merchant/billing/gateways/protx.rb
106
117
  - lib/active_merchant/billing/gateways/psigate.rb
107
118
  - lib/active_merchant/billing/gateways/psl_card.rb
108
119
  - lib/active_merchant/billing/gateways/quickpay.rb
109
120
  - lib/active_merchant/billing/gateways/realex.rb
121
+ - lib/active_merchant/billing/gateways/sage
122
+ - lib/active_merchant/billing/gateways/sage/sage_bankcard.rb
123
+ - lib/active_merchant/billing/gateways/sage/sage_core.rb
124
+ - lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb
125
+ - lib/active_merchant/billing/gateways/sage.rb
110
126
  - lib/active_merchant/billing/gateways/secure_pay.rb
111
127
  - lib/active_merchant/billing/gateways/secure_pay_au.rb
112
128
  - lib/active_merchant/billing/gateways/secure_pay_tech.rb
@@ -116,6 +132,7 @@ files:
116
132
  - lib/active_merchant/billing/gateways/usa_epay.rb
117
133
  - lib/active_merchant/billing/gateways/verifi.rb
118
134
  - lib/active_merchant/billing/gateways/viaklix.rb
135
+ - lib/active_merchant/billing/gateways/wirecard.rb
119
136
  - lib/active_merchant/billing/gateways.rb
120
137
  - lib/active_merchant/billing/integrations
121
138
  - lib/active_merchant/billing/integrations/action_view_helper.rb
@@ -181,7 +198,10 @@ files:
181
198
  - test/fixtures.yml
182
199
  - test/remote
183
200
  - test/remote/gateways
201
+ - test/remote/gateways/remote_authorize_net_cim_test.rb
184
202
  - test/remote/gateways/remote_authorize_net_test.rb
203
+ - test/remote/gateways/remote_beanstream_interac_test.rb
204
+ - test/remote/gateways/remote_beanstream_test.rb
185
205
  - test/remote/gateways/remote_braintree_test.rb
186
206
  - test/remote/gateways/remote_card_stream_test.rb
187
207
  - test/remote/gateways/remote_cyber_source_test.rb
@@ -190,6 +210,8 @@ files:
190
210
  - test/remote/gateways/remote_eway_test.rb
191
211
  - test/remote/gateways/remote_exact_test.rb
192
212
  - test/remote/gateways/remote_linkpoint_test.rb
213
+ - test/remote/gateways/remote_modern_payments_cim_test.rb
214
+ - test/remote/gateways/remote_modern_payments_test.rb
193
215
  - test/remote/gateways/remote_moneris_test.rb
194
216
  - test/remote/gateways/remote_net_registry_test.rb
195
217
  - test/remote/gateways/remote_netbilling_test.rb
@@ -207,6 +229,9 @@ files:
207
229
  - test/remote/gateways/remote_psl_card_test.rb
208
230
  - test/remote/gateways/remote_quickpay_test.rb
209
231
  - test/remote/gateways/remote_realex_test.rb
232
+ - test/remote/gateways/remote_sage_bankcard_test.rb
233
+ - test/remote/gateways/remote_sage_test.rb
234
+ - test/remote/gateways/remote_sage_virtual_check_test.rb
210
235
  - test/remote/gateways/remote_secure_pay_au_test.rb
211
236
  - test/remote/gateways/remote_secure_pay_tech_test.rb
212
237
  - test/remote/gateways/remote_secure_pay_test.rb
@@ -216,6 +241,7 @@ files:
216
241
  - test/remote/gateways/remote_usa_epay_test.rb
217
242
  - test/remote/gateways/remote_verifi_test.rb
218
243
  - test/remote/gateways/remote_viaklix_test.rb
244
+ - test/remote/gateways/remote_wirecard_test.rb
219
245
  - test/remote/integrations
220
246
  - test/remote/integrations/remote_gestpay_integration_test.rb
221
247
  - test/remote/integrations/remote_paypal_integration_test.rb
@@ -232,7 +258,10 @@ files:
232
258
  - test/unit/cvv_result_test.rb
233
259
  - test/unit/expiry_date_test.rb
234
260
  - test/unit/gateways
261
+ - test/unit/gateways/authorize_net_cim_test.rb
235
262
  - test/unit/gateways/authorize_net_test.rb
263
+ - test/unit/gateways/beanstream_interac_test.rb
264
+ - test/unit/gateways/beanstream_test.rb
236
265
  - test/unit/gateways/bogus_test.rb
237
266
  - test/unit/gateways/braintree_test.rb
238
267
  - test/unit/gateways/card_stream_test.rb
@@ -243,6 +272,7 @@ files:
243
272
  - test/unit/gateways/exact_test.rb
244
273
  - test/unit/gateways/gateway_test.rb
245
274
  - test/unit/gateways/linkpoint_test.rb
275
+ - test/unit/gateways/modern_payments_cim_test.rb
246
276
  - test/unit/gateways/moneris_test.rb
247
277
  - test/unit/gateways/net_registry_test.rb
248
278
  - test/unit/gateways/netbilling_test.rb
@@ -261,6 +291,8 @@ files:
261
291
  - test/unit/gateways/psl_card_test.rb
262
292
  - test/unit/gateways/quickpay_test.rb
263
293
  - test/unit/gateways/realex_test.rb
294
+ - test/unit/gateways/sage_bankcard_test.rb
295
+ - test/unit/gateways/sage_virtual_check_test.rb
264
296
  - test/unit/gateways/secure_pay_au_test.rb
265
297
  - test/unit/gateways/secure_pay_tech_test.rb
266
298
  - test/unit/gateways/secure_pay_test.rb
@@ -270,6 +302,7 @@ files:
270
302
  - test/unit/gateways/usa_epay_test.rb
271
303
  - test/unit/gateways/verifi_test.rb
272
304
  - test/unit/gateways/viaklix_test.rb
305
+ - test/unit/gateways/wirecard_test.rb
273
306
  - test/unit/generators
274
307
  - test/unit/generators/test_gateway_generator.rb
275
308
  - test/unit/generators/test_generator_helper.rb
@@ -316,11 +349,13 @@ files:
316
349
  - script/generate
317
350
  - CHANGELOG
318
351
  - CONTRIBUTERS
352
+ - doc
319
353
  - gem-public_cert.pem
320
354
  - generators
321
355
  - init.rb
322
356
  - lib
323
357
  - MIT-LICENSE
358
+ - pkg
324
359
  - Rakefile
325
360
  - README
326
361
  - script
@@ -346,8 +381,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
346
381
  version:
347
382
  requirements: []
348
383
 
349
- rubyforge_project:
350
- rubygems_version: 1.0.1
384
+ rubyforge_project: activemerchant
385
+ rubygems_version: 1.3.1
351
386
  signing_key:
352
387
  specification_version: 2
353
388
  summary: Framework and tools for dealing with credit card transactions.
metadata.gz.sig CHANGED
Binary file