Module: Klarna::Checkout::ApiUtilities::ConnectionUtilities

Included in:
Operations::Fetch, Order
Defined in:
lib/klarna/checkout/api_utilities/connection_utilities.rb

Constant Summary collapse

KLARNA_SANDBOX_URL =
'https://api.playground.klarna.com'
KLARNA_PRODUCTION_URL =
'https://api.klarna.com'

Instance Method Summary collapse

Instance Method Details

#hostObject



10
11
12
13
14
# File 'lib/klarna/checkout/api_utilities/connection_utilities.rb', line 10

def host
  return KLARNA_PRODUCTION_URL if Klarna::Checkout.configuration.environment == 'production'

  KLARNA_SANDBOX_URL
end

#https_connectionObject



16
17
18
# File 'lib/klarna/checkout/api_utilities/connection_utilities.rb', line 16

def https_connection
  @https_connection ||= Faraday.new(url: host)
end