activemerchant 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,5 +1,9 @@
1
1
  = ActiveMerchant CHANGELOG
2
2
 
3
+ == Version 1.3.1 (January 28, 2008)
4
+
5
+ * Rename BrainTreeGateway to BraintreeGateway, but keep alias to old naming for backwards compatibility [cody]
6
+
3
7
  == Version 1.3.0 (January 28, 2008)
4
8
 
5
9
  * Remove attr_readers for url and response from Gateway [cody]
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ require File.dirname(__FILE__) + '/lib/tasks/cia'
8
8
  require File.dirname(__FILE__) + '/lib/support/gateway_support'
9
9
 
10
10
 
11
- PKG_VERSION = "1.3.0"
11
+ PKG_VERSION = "1.3.1"
12
12
  PKG_NAME = "activemerchant"
13
13
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
14
14
 
@@ -2,7 +2,7 @@ require File.join(File.dirname(__FILE__), '..', 'check.rb')
2
2
 
3
3
  module ActiveMerchant #:nodoc:
4
4
  module Billing #:nodoc:
5
- class BrainTreeGateway < Gateway
5
+ class BraintreeGateway < Gateway
6
6
  URL = 'https://secure.braintreepaymentgateway.com/api/transact.php'
7
7
 
8
8
  self.supported_countries = ['US']
@@ -198,6 +198,8 @@ module ActiveMerchant #:nodoc:
198
198
  end
199
199
  end
200
200
  end
201
+
202
+ BrainTreeGateway = BraintreeGateway
201
203
  end
202
204
  end
203
205
 
data/test/fixtures.yml CHANGED
@@ -14,7 +14,7 @@ authorize_net:
14
14
  login: X
15
15
  password: Y
16
16
 
17
- brain_tree:
17
+ braintree:
18
18
  login: demo
19
19
  password: password
20
20
 
@@ -1,8 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../../test_helper'
2
2
 
3
- class RemoteBrainTreeTest < Test::Unit::TestCase
3
+ class RemoteBraintreeTest < Test::Unit::TestCase
4
4
  def setup
5
- @gateway = BrainTreeGateway.new(fixtures(:brain_tree))
5
+ @gateway = BraintreeGateway.new(fixtures(:braintree))
6
6
 
7
7
  @amount = rand(10000) + 1001
8
8
  @credit_card = credit_card('4111111111111111', :type => 'visa')
@@ -18,6 +18,13 @@ class RemoteBrainTreeTest < Test::Unit::TestCase
18
18
  assert_success response
19
19
  end
20
20
 
21
+ def test_successful_purchase_with_old_naming
22
+ gateway = BrainTreeGateway.new(fixtures(:braintree))
23
+ assert response = gateway.purchase(@amount, @credit_card, @options)
24
+ assert_equal 'This transaction has been approved', response.message
25
+ assert_success response
26
+ end
27
+
21
28
  def test_successful_purchase_with_echeck
22
29
  check = ActiveMerchant::Billing::Check.new(
23
30
  :name => 'Fredd Bloggs',
@@ -107,7 +114,7 @@ class RemoteBrainTreeTest < Test::Unit::TestCase
107
114
  end
108
115
 
109
116
  def test_invalid_login
110
- gateway = BrainTreeGateway.new(
117
+ gateway = BraintreeGateway.new(
111
118
  :login => '',
112
119
  :password => ''
113
120
  )
@@ -1,9 +1,9 @@
1
1
  require File.dirname(__FILE__) + '/../../test_helper'
2
2
 
3
- class BrainTreeTest < Test::Unit::TestCase
3
+ class BraintreeTest < Test::Unit::TestCase
4
4
 
5
5
  def setup
6
- @gateway = BrainTreeGateway.new(
6
+ @gateway = BraintreeGateway.new(
7
7
  :login => 'LOGIN',
8
8
  :password => 'PASSWORD'
9
9
  )
@@ -46,11 +46,11 @@ class BrainTreeTest < Test::Unit::TestCase
46
46
  end
47
47
 
48
48
  def test_supported_countries
49
- assert_equal ['US'], BrainTreeGateway.supported_countries
49
+ assert_equal ['US'], BraintreeGateway.supported_countries
50
50
  end
51
51
 
52
52
  def test_supported_card_types
53
- assert_equal [:visa, :master, :american_express], BrainTreeGateway.supported_cardtypes
53
+ assert_equal [:visa, :master, :american_express], BraintreeGateway.supported_cardtypes
54
54
  end
55
55
 
56
56
  def test_adding_store_adds_vault_id_flag
@@ -99,6 +99,14 @@ class BrainTreeTest < Test::Unit::TestCase
99
99
  response = @gateway.purchase(@amount, @credit_card)
100
100
  assert_equal 'N', response.cvv_result['code']
101
101
  end
102
+
103
+ def test_gateway_should_be_available_as_brain_tree
104
+ gateway = BrainTreeGateway.new(:login => 'l', :password => 'p')
105
+ gateway.expects(:ssl_post).returns(successful_purchase_response)
106
+ response = gateway.purchase(@amount, @credit_card)
107
+ assert_success response
108
+
109
+ end
102
110
 
103
111
  private
104
112
  def successful_purchase_response
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemerchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke
@@ -74,7 +74,7 @@ files:
74
74
  - lib/active_merchant/billing/gateways
75
75
  - lib/active_merchant/billing/gateways/authorize_net.rb
76
76
  - lib/active_merchant/billing/gateways/bogus.rb
77
- - lib/active_merchant/billing/gateways/brain_tree.rb
77
+ - lib/active_merchant/billing/gateways/braintree.rb
78
78
  - lib/active_merchant/billing/gateways/card_stream.rb
79
79
  - lib/active_merchant/billing/gateways/cyber_source.rb
80
80
  - lib/active_merchant/billing/gateways/data_cash.rb
@@ -181,7 +181,7 @@ files:
181
181
  - test/remote
182
182
  - test/remote/gateways
183
183
  - test/remote/gateways/remote_authorize_net_test.rb
184
- - test/remote/gateways/remote_brain_tree_test.rb
184
+ - test/remote/gateways/remote_braintree_test.rb
185
185
  - test/remote/gateways/remote_card_stream_test.rb
186
186
  - test/remote/gateways/remote_cyber_source_test.rb
187
187
  - test/remote/gateways/remote_data_cash_test.rb
@@ -232,7 +232,7 @@ files:
232
232
  - test/unit/gateways
233
233
  - test/unit/gateways/authorize_net_test.rb
234
234
  - test/unit/gateways/bogus_test.rb
235
- - test/unit/gateways/brain_tree_test.rb
235
+ - test/unit/gateways/braintree_test.rb
236
236
  - test/unit/gateways/card_stream_test.rb
237
237
  - test/unit/gateways/cyber_source_test.rb
238
238
  - test/unit/gateways/data_cash_test.rb
metadata.gz.sig CHANGED
Binary file