Module: Tray::Checkout::Config

Included in:
Tray::Checkout
Defined in:
lib/tray/checkout/config.rb

Constant Summary collapse

DEFAULT_REQUEST_TIMEOUT =

seconds

5
DEFAULT_ENVIRONMENT =
:production

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#environmentObject



13
14
15
# File 'lib/tray/checkout/config.rb', line 13

def environment
  @environment ||= DEFAULT_ENVIRONMENT
end

#proxy_urlObject



29
30
31
# File 'lib/tray/checkout/config.rb', line 29

def proxy_url
  @proxy_url ||= ""
end

#request_timeoutObject



25
26
27
# File 'lib/tray/checkout/config.rb', line 25

def request_timeout
  (@request_timeout ||= DEFAULT_REQUEST_TIMEOUT).to_i
end

#token_accountObject

Returns the value of attribute token_account.



8
9
10
# File 'lib/tray/checkout/config.rb', line 8

def 
  @token_account
end

Instance Method Details

#api_urlObject



17
18
19
20
21
22
23
# File 'lib/tray/checkout/config.rb', line 17

def api_url
  if environment == :production
    "https://api.traycheckout.com.br/"
  else
    "http://api.sandbox.traycheckout.com.br/"
  end
end