activemerchant 1.78.0 → 1.79.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 (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +49 -0
  3. data/lib/active_merchant.rb +2 -5
  4. data/lib/active_merchant/billing/credit_card_methods.rb +3 -1
  5. data/lib/active_merchant/billing/gateways/adyen.rb +17 -2
  6. data/lib/active_merchant/billing/gateways/authorize_net.rb +16 -11
  7. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +1 -0
  8. data/lib/active_merchant/billing/gateways/borgun.rb +0 -1
  9. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +1 -0
  10. data/lib/active_merchant/billing/gateways/braintree_blue.rb +17 -4
  11. data/lib/active_merchant/billing/gateways/checkout_v2.rb +7 -0
  12. data/lib/active_merchant/billing/gateways/clearhaus.rb +0 -2
  13. data/lib/active_merchant/billing/gateways/cyber_source.rb +11 -2
  14. data/lib/active_merchant/billing/gateways/ebanx.rb +3 -3
  15. data/lib/active_merchant/billing/gateways/elavon.rb +1 -1
  16. data/lib/active_merchant/billing/gateways/first_pay.rb +10 -9
  17. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +11 -0
  18. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +12 -0
  19. data/lib/active_merchant/billing/gateways/migs.rb +0 -2
  20. data/lib/active_merchant/billing/gateways/mundipagg.rb +291 -0
  21. data/lib/active_merchant/billing/gateways/nab_transact.rb +4 -4
  22. data/lib/active_merchant/billing/gateways/paymentez.rb +6 -13
  23. data/lib/active_merchant/billing/gateways/paypal.rb +0 -12
  24. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +14 -0
  25. data/lib/active_merchant/billing/gateways/paystation.rb +10 -0
  26. data/lib/active_merchant/billing/gateways/psigate.rb +11 -0
  27. data/lib/active_merchant/billing/gateways/qbms.rb +11 -0
  28. data/lib/active_merchant/billing/gateways/realex.rb +14 -1
  29. data/lib/active_merchant/billing/gateways/redsys.rb +1 -1
  30. data/lib/active_merchant/billing/gateways/safe_charge.rb +8 -4
  31. data/lib/active_merchant/billing/gateways/smart_ps.rb +1 -1
  32. data/lib/active_merchant/billing/gateways/spreedly_core.rb +41 -6
  33. data/lib/active_merchant/billing/gateways/stripe.rb +14 -4
  34. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +6 -1
  35. data/lib/active_merchant/billing/gateways/worldpay.rb +45 -14
  36. data/lib/active_merchant/connection.rb +38 -9
  37. data/lib/active_merchant/net_http_ssl_connection.rb +9 -0
  38. data/lib/active_merchant/network_connection_retries.rb +2 -0
  39. data/lib/active_merchant/posts_data.rb +10 -0
  40. data/lib/active_merchant/version.rb +1 -1
  41. data/lib/support/ssl_version.rb +87 -0
  42. metadata +7 -4
@@ -0,0 +1,9 @@
1
+ require 'net/http'
2
+
3
+ module NetHttpSslConnection
4
+ refine Net::HTTP do
5
+ def ssl_connection
6
+ { version: @socket.io.ssl_version, cipher: @socket.io.cipher[0] }
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,5 @@
1
+ require 'openssl'
2
+
1
3
  module ActiveMerchant
2
4
  module NetworkConnectionRetries
3
5
  DEFAULT_RETRIES = 3
@@ -8,6 +8,12 @@ module ActiveMerchant #:nodoc:
8
8
  base.class_attribute :ssl_version
9
9
  base.ssl_version = nil
10
10
 
11
+ base.class_attribute :min_version
12
+ base.min_version = nil
13
+
14
+ base.class_attribute :max_version
15
+ base.min_version = nil
16
+
11
17
  base.class_attribute :retry_safe
12
18
  base.retry_safe = false
13
19
 
@@ -53,6 +59,10 @@ module ActiveMerchant #:nodoc:
53
59
  connection.max_retries = max_retries
54
60
  connection.tag = self.class.name
55
61
  connection.wiredump_device = wiredump_device
62
+ if connection.respond_to?(:min_version=)
63
+ connection.min_version = min_version
64
+ connection.max_version = max_version
65
+ end
56
66
 
57
67
  connection.pem = @options[:pem] if @options
58
68
  connection.pem_password = @options[:pem_password] if @options
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = "1.78.0"
2
+ VERSION = "1.79.0"
3
3
  end
@@ -0,0 +1,87 @@
1
+ require "active_merchant"
2
+ require "support/gateway_support"
3
+
4
+ class SSLVersion
5
+ attr_accessor :success, :failed, :missing, :errored
6
+
7
+ def initialize
8
+ @gateways = GatewaySupport.new.gateways
9
+ @success, @failed, @missing, @errored = [], [], [], []
10
+ end
11
+
12
+ def test_gateways(min_version = :TLS1_1)
13
+ raise "Requires Ruby 2.5 or better" unless Net::HTTP.instance_methods.include?(:min_version=)
14
+
15
+ puts "Verifying #{@gateways.count} gateways for SSL min_version=#{min_version}\n\n"
16
+
17
+ @gateways.each do |g|
18
+ unless g.live_url
19
+ missing << g unless g.abstract_class
20
+ next
21
+ end
22
+
23
+ uri = URI.parse(g.live_url)
24
+ result, message = test_min_version(uri, min_version)
25
+
26
+ case result
27
+ when :success
28
+ print "."
29
+ success << g
30
+ when :fail
31
+ print "F"
32
+ failed << {:gateway => g, :message => message}
33
+ when :error
34
+ print "E"
35
+ errored << {:gateway => g, :message => message}
36
+ end
37
+ end
38
+
39
+ print_summary
40
+ end
41
+
42
+ def print_summary
43
+ puts "\n\nSucceeded gateways (#{success.length})"
44
+
45
+ puts "\n\nFailed Gateways (#{failed.length}):"
46
+ failed.each do |f|
47
+ puts "#{f[:gateway].name} - #{f[:message]}"
48
+ end
49
+
50
+ puts "\n\nError Gateways (#{errored.length}):"
51
+ errored.each do |e|
52
+ puts "#{e[:gateway].name} - #{e[:message]}"
53
+ end
54
+
55
+ if missing.length > 0
56
+ puts "\n\nGateways missing live_url (#{missing.length}):"
57
+ missing.each do |m|
58
+ puts m.name
59
+ end
60
+ end
61
+ end
62
+
63
+ private
64
+
65
+ def test_min_version(uri, min_version)
66
+ http = Net::HTTP.new(uri.host, uri.port)
67
+ http.use_ssl = true
68
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE # don't care about certificate validity, just protocol version
69
+ http.min_version = min_version
70
+ http.open_timeout = 10
71
+ http.read_timeout = 10
72
+
73
+ http.post("/", "")
74
+
75
+ return :success
76
+ rescue Net::HTTPBadResponse
77
+ return :success # version negotiation succeeded
78
+ rescue OpenSSL::SSL::SSLError => ex
79
+ return :fail, ex.inspect
80
+ rescue Interrupt => ex
81
+ print_summary
82
+ raise ex
83
+ rescue StandardError => ex
84
+ return :error, ex.inspect
85
+ end
86
+
87
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemerchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.78.0
4
+ version: 1.79.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-29 00:00:00.000000000 Z
11
+ date: 2018-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.2.14
19
+ version: '4.2'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 6.x
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 3.2.14
29
+ version: '4.2'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 6.x
@@ -273,6 +273,7 @@ files:
273
273
  - lib/active_merchant/billing/gateways/moneris.rb
274
274
  - lib/active_merchant/billing/gateways/moneris_us.rb
275
275
  - lib/active_merchant/billing/gateways/money_movers.rb
276
+ - lib/active_merchant/billing/gateways/mundipagg.rb
276
277
  - lib/active_merchant/billing/gateways/nab_transact.rb
277
278
  - lib/active_merchant/billing/gateways/ncr_secure_pay.rb
278
279
  - lib/active_merchant/billing/gateways/net_registry.rb
@@ -387,6 +388,7 @@ files:
387
388
  - lib/active_merchant/country.rb
388
389
  - lib/active_merchant/empty.rb
389
390
  - lib/active_merchant/errors.rb
391
+ - lib/active_merchant/net_http_ssl_connection.rb
390
392
  - lib/active_merchant/network_connection_retries.rb
391
393
  - lib/active_merchant/post_data.rb
392
394
  - lib/active_merchant/posts_data.rb
@@ -396,6 +398,7 @@ files:
396
398
  - lib/support/gateway_support.rb
397
399
  - lib/support/outbound_hosts.rb
398
400
  - lib/support/ssl_verify.rb
401
+ - lib/support/ssl_version.rb
399
402
  homepage: http://activemerchant.org/
400
403
  licenses:
401
404
  - MIT