Sha256: e7be8f174be4c548d3fb4afad94dc035c5cb9843e176df0d79bb637eeb790623

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true

require_relative "shipay/version"
require_relative "shipay/authenticator"
require_relative "shipay/request"
require_relative "shipay/object"
require_relative "shipay/model"
require_relative "shipay/core_ext"
require_relative "shipay/errors"
require_relative "shipay/util"
require_relative "shipay/token_manager"
require_relative "shipay/order_commom"


Dir[File.expand_path('../shipay/resources/*.rb', __FILE__)].map do |path|
  require path
end

module Shipay
  class Error < StandardError; end

  class << self
    attr_accessor :access_key, :secret_key, :client_id, :callback_url, :credentials, :default_client_key
    attr_reader :api_endpoint

    def production?
      ENV["RACK_ENV"] == "production" ||
        ENV["RAILS_ENV"] == "production" ||
        ENV["PRODUCTION"] ||
        ENV["production"] || (Rails.env.production? if Object.const_defined?('::Rails'))

      rescue NameError => e
        return false
    end
  end

  @default_client_key = :default

  @api_endpoint = ( Shipay.production? )? "https://api.shipay.com.br" : "https://api-staging.shipay.com.br"

  puts "Running on production" if production?

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shipay-0.1.5 lib/shipay.rb