activemerchant 1.7.1 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/CHANGELOG +5 -0
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +1 -1
- data/lib/active_merchant/billing/gateways/sage_pay.rb +10 -2
- data/lib/active_merchant/billing/integrations/action_view_helper.rb +16 -19
- data/lib/active_merchant/version.rb +1 -1
- metadata +4 -4
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
= ActiveMerchant CHANGELOG
|
2
2
|
|
3
|
+
== Version 1.7.2 (August 27, 2010)
|
4
|
+
|
5
|
+
* Update Braintree integration to play nicely with the braintree 2.5.0 gem [Soleone]
|
6
|
+
* Fix SagePay to not send fractional amounts for Chinese YEN currency [Soleone]
|
7
|
+
|
3
8
|
== Version 1.7.1 (July 28, 2010)
|
4
9
|
|
5
10
|
* Pull in only the necessary components of Active Support. Enables use of ActiveMerchant with Rails 3 [railsjedi]
|
@@ -22,7 +22,7 @@ module ActiveMerchant #:nodoc:
|
|
22
22
|
Braintree::Configuration.public_key = options[:public_key]
|
23
23
|
Braintree::Configuration.private_key = options[:private_key]
|
24
24
|
Braintree::Configuration.environment = test? ? :sandbox : :production
|
25
|
-
Braintree::Configuration.logger.level = Logger::ERROR
|
25
|
+
Braintree::Configuration.logger.level = Logger::ERROR if Braintree::Configuration.logger
|
26
26
|
Braintree::Configuration.custom_user_agent = "ActiveMerchant #{ActiveMerchant::VERSION}"
|
27
27
|
super
|
28
28
|
end
|
@@ -31,6 +31,8 @@ module ActiveMerchant #:nodoc:
|
|
31
31
|
:diners_club => "DC",
|
32
32
|
:jcb => "JCB"
|
33
33
|
}
|
34
|
+
|
35
|
+
CURRENCIES_WITHOUT_FRACTIONS = [ 'YEN' ]
|
34
36
|
|
35
37
|
ELECTRON = /^(424519|42496[23]|450875|48440[6-8]|4844[1-5][1-5]|4917[3-5][0-9]|491880)\d{10}(\d{3})?$/
|
36
38
|
|
@@ -138,8 +140,9 @@ module ActiveMerchant #:nodoc:
|
|
138
140
|
end
|
139
141
|
|
140
142
|
def add_amount(post, money, options)
|
141
|
-
|
142
|
-
add_pair(post, :
|
143
|
+
currency = options[:currency] || currency(money)
|
144
|
+
add_pair(post, :Amount, localized_amount(money, currency), :required => true)
|
145
|
+
add_pair(post, :Currency, currency, :required => true)
|
143
146
|
end
|
144
147
|
|
145
148
|
# doesn't actually use the currency -- dodgy!
|
@@ -303,6 +306,11 @@ module ActiveMerchant #:nodoc:
|
|
303
306
|
first_name = name.join(' ')
|
304
307
|
[ first_name[0,20], last_name[0,20] ]
|
305
308
|
end
|
309
|
+
|
310
|
+
def localized_amount(money, currency)
|
311
|
+
amount = amount(money)
|
312
|
+
CURRENCIES_WITHOUT_FRACTIONS.include?(currency.to_s) ? amount.split('.').first : amount
|
313
|
+
end
|
306
314
|
end
|
307
315
|
end
|
308
316
|
end
|
@@ -44,34 +44,31 @@ module ActiveMerchant #:nodoc:
|
|
44
44
|
|
45
45
|
integration_module = ActiveMerchant::Billing::Integrations.const_get(options.delete(:service).to_s.classify)
|
46
46
|
|
47
|
-
|
48
|
-
|
49
|
-
else
|
50
|
-
concat(form_tag(integration_module.service_url, options.delete(:html) || {}), proc.binding)
|
51
|
-
end
|
52
|
-
result = "\n"
|
47
|
+
result = []
|
48
|
+
result << form_tag(integration_module.service_url, options.delete(:html) || {})
|
53
49
|
|
54
50
|
service_class = integration_module.const_get('Helper')
|
55
51
|
service = service_class.new(order, account, options)
|
56
|
-
yield service
|
57
|
-
|
58
|
-
result << service.form_fields.collect do |field, value|
|
59
|
-
hidden_field_tag(field, value)
|
60
|
-
end.join("\n")
|
61
52
|
|
62
|
-
result <<
|
63
|
-
result << '</form>'
|
53
|
+
result << capture(service, &proc)
|
64
54
|
|
65
|
-
|
66
|
-
|
67
|
-
else
|
68
|
-
concat(result, proc.binding)
|
55
|
+
service.form_fields.each do |field, value|
|
56
|
+
result << hidden_field_tag(field, value)
|
69
57
|
end
|
58
|
+
|
59
|
+
result << '</form>'
|
60
|
+
|
61
|
+
concat(html_safe_string(result.join("\n")))
|
70
62
|
end
|
71
63
|
|
72
64
|
private
|
73
|
-
|
74
|
-
|
65
|
+
|
66
|
+
def html_safe_string(string)
|
67
|
+
if string.respond_to?(:html_safe)
|
68
|
+
string.html_safe
|
69
|
+
else
|
70
|
+
string
|
71
|
+
end
|
75
72
|
end
|
76
73
|
end
|
77
74
|
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:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 1.7.
|
9
|
+
- 2
|
10
|
+
version: 1.7.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tobias Luetke
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
hPaSTyVU0yCSnw==
|
37
37
|
-----END CERTIFICATE-----
|
38
38
|
|
39
|
-
date: 2010-
|
39
|
+
date: 2010-08-27 00:00:00 -04:00
|
40
40
|
default_executable:
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
metadata.gz.sig
CHANGED
Binary file
|