class OmniAuth::Strategies::Mercadopago

Constants

API_ROOT_URL
AUTH_URL
OAUTH_URL

Public Instance Methods

authorize_params() click to toggle source
Calls superclass method
# File lib/omniauth/strategies/mercadopago.rb, line 30
def authorize_params
  logger.info " === callback_url: #{callback_url} === "
  super.tap do |params|
    params[:response_type ] = "code"
    params[:client_id]      = client.id
    params[:redirect_uri]   = callback_url.to_s.downcase
  end
end
build_access_token() click to toggle source
# File lib/omniauth/strategies/mercadopago.rb, line 39
def build_access_token
  logger.info " === build_access_token callback_url= #{callback_url} === "
  logger.info " === build_access_token options= #{options} === "
  token_params = {
    code:           request.params['code'],
    redirect_uri:   callback_url.to_s.downcase,
    client_id:      client.id,
    client_secret:  client.secret,
    grant_type:     'authorization_code'
  }
  client.get_token(token_params)
end
callback_url() click to toggle source
# File lib/omniauth/strategies/mercadopago.rb, line 24
def callback_url
  # As ariginally was in the omniauth-oauth2 gem
  # https://github.com/intridea/omniauth-oauth2/pull/70/files
  full_host + script_name + callback_path
end
params_token() click to toggle source
# File lib/omniauth/strategies/mercadopago.rb, line 77
def params_token
  { params: access_token.to_hash }
end
raw_info() click to toggle source
# File lib/omniauth/strategies/mercadopago.rb, line 73
def raw_info
  @raw_info ||= access_token.get("users/me", params_token).parsed
end
request_phase() click to toggle source
Calls superclass method
# File lib/omniauth/strategies/mercadopago.rb, line 20
def request_phase
  super
end

Private Instance Methods

logger() click to toggle source
# File lib/omniauth/strategies/mercadopago.rb, line 83
def logger
  OmniAuth.logger
end
prune!(hash) click to toggle source
# File lib/omniauth/strategies/mercadopago.rb, line 95
def prune!(hash)
  hash.delete_if do |_, v|
    prune!(v) if v.is_a?(Hash)
    v.nil? || (v.respond_to?(:empty?) && v.empty?)
  end
end