Sha256: 58d86d6b34d11af3c282f4d90081e8a88fe4a96f1bc5a7fb25e35a5f763978ed

Contents?: true

Size: 795 Bytes

Versions: 3

Compression:

Stored size: 795 Bytes

Contents

module Braintree
  module SSLExpirationCheck # :nodoc:
    class << self
      attr_reader :ssl_expiration_dates_checked
    end

    def self.check_dates # :nodoc:
      {
        "Sandbox" => sandbox_expiration_date,
        "Production" => production_expiration_date
      }.each do |host, expiration_date|
        if Date.today + (3 * 30) > expiration_date
          Configuration.logger.warn "[Braintree] The SSL Certificate for the #{host} environment will expire on #{expiration_date}. Please check for an updated client library."
        end
      end
      @ssl_expiration_dates_checked = true
    end

    def self.production_expiration_date # :nodoc:
      Date.civil(2012, 1, 8)
    end

    def self.sandbox_expiration_date # :nodoc:
      Date.civil(2010, 12, 1)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
braintree-2.5.1 lib/braintree/ssl_expiration_check.rb
braintree-2.4.0 lib/braintree/ssl_expiration_check.rb
braintree-2.3.1 lib/braintree/ssl_expiration_check.rb