Class: OmniAuth::Strategies::PaypalOauth2

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omniauth/strategies/paypal_oauth2.rb

Constant Summary collapse

DEFAULT_SCOPE =
'openid email profile'
DEFAULT_RESPONSE_TYPE =
'code'
SANDBOX_SITE =
'https://api.sandbox.paypal.com'
SANDBOX_AUTHORIZE_URL =
'https://www.sandbox.paypal.com/signin/authorize'

Instance Method Summary collapse

Instance Method Details

#authorize_paramsObject



69
70
71
72
73
74
# File 'lib/omniauth/strategies/paypal_oauth2.rb', line 69

def authorize_params
  super.tap do |params|
    params[:scope] ||= DEFAULT_SCOPE
    params[:response_type] ||= DEFAULT_RESPONSE_TYPE
  end
end

#callback_urlObject



53
54
55
# File 'lib/omniauth/strategies/paypal_oauth2.rb', line 53

def callback_url
  full_host + script_name + callback_path
end

#raw_infoObject



65
66
67
# File 'lib/omniauth/strategies/paypal_oauth2.rb', line 65

def raw_info
  @raw_info ||= load_identity
end

#setup_phaseObject



57
58
59
60
61
62
63
# File 'lib/omniauth/strategies/paypal_oauth2.rb', line 57

def setup_phase
  if options.sandbox
    options.client_options[:site] = SANDBOX_SITE
    options.client_options[:authorize_url] = SANDBOX_AUTHORIZE_URL
  end
  super
end