Method: SolidusPaypalCommercePlatform::Configuration#default_env

Defined in:
lib/solidus_paypal_commerce_platform/configuration.rb

#default_envObject



41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/solidus_paypal_commerce_platform/configuration.rb', line 41

def default_env
  return ENV['PAYPAL_ENV'] if ENV['PAYPAL_ENV']

  case Rails.env
  when 'production'
    'live'
  when 'test', 'development'
    'sandbox'
  else
    raise InvalidEnvironment, "Unable to guess the PayPal env, please set #{self}.env= explicitly."
  end
end