activemerchant 1.18.0 → 1.18.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,10 @@
1
1
  = ActiveMerchant CHANGELOG
2
2
 
3
+ == Version 1.18.1 (September 23, 2011)
4
+
5
+ * Braintree: allow setting merchant_account_id on initialize [jduff]
6
+ * Realex: only send letters and numbers in shipping code field [Soleone]
7
+
3
8
  == Version 1.18.0 (September 23, 2011)
4
9
 
5
10
  * NoChex: Update the URL that payment requests are posted to [caseywhalen/jduff]
@@ -18,6 +18,7 @@ module ActiveMerchant #:nodoc:
18
18
  def initialize(options = {})
19
19
  requires!(options, :merchant_id, :public_key, :private_key)
20
20
  @options = options
21
+ @merchant_account_id = options[:merchant_account_id]
21
22
  Braintree::Configuration.merchant_id = options[:merchant_id]
22
23
  Braintree::Configuration.public_key = options[:public_key]
23
24
  Braintree::Configuration.private_key = options[:private_key]
@@ -276,8 +277,8 @@ module ActiveMerchant #:nodoc:
276
277
  :submit_for_settlement => options[:submit_for_settlement]
277
278
  }
278
279
  }
279
- if options.has_key?(:merchant_account_id)
280
- parameters[:merchant_account_id] = options[:merchant_account_id]
280
+ if merchant_account_id = (options[:merchant_account_id] || @merchant_account_id)
281
+ parameters[:merchant_account_id] = merchant_account_id
281
282
  end
282
283
  if credit_card_or_vault_id.is_a?(String) || credit_card_or_vault_id.is_a?(Integer)
283
284
  parameters[:customer_id] = credit_card_or_vault_id
@@ -197,7 +197,7 @@ module ActiveMerchant
197
197
 
198
198
  if shipping_address
199
199
  xml.tag! 'address', 'type' => 'shipping' do
200
- xml.tag! 'code', avs_input_code( shipping_address )
200
+ xml.tag! 'code', format_shipping_zip_code(shipping_address[:zip])
201
201
  xml.tag! 'country', shipping_address[:country]
202
202
  end
203
203
  end
@@ -247,6 +247,10 @@ module ActiveMerchant
247
247
  address.values_at(:zip, :address1).map{ |v| extract_digits(v) }.join('|')
248
248
  end
249
249
 
250
+ def format_shipping_zip_code(zip)
251
+ zip.to_s.gsub(/\W/, '')
252
+ end
253
+
250
254
  def extract_digits(string)
251
255
  return "" if string.nil?
252
256
  string.gsub(/[\D]/,'')
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = "1.18.0"
2
+ VERSION = "1.18.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemerchant
3
3
  version: !ruby/object:Gem::Version
4
- hash: 95
4
+ hash: 93
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 18
9
- - 0
10
- version: 1.18.0
9
+ - 1
10
+ version: 1.18.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tobias Luetke
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain:
17
17
  - gem-public_cert.pem
18
- date: 2011-09-23 00:00:00 -04:00
18
+ date: 2011-09-30 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency