Class: OmniAuth::Strategies::Mercadopago
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Mercadopago
- Defined in:
- lib/omniauth/strategies/mercadopago.rb
Constant Summary collapse
- API_ROOT_URL =
"https://api.mercadopago.com"- AUTH_URL =
"https://auth.mercadopago.com/authorization"- OAUTH_URL =
"/oauth/token"
Instance Method Summary collapse
- #authorize_params ⇒ Object
- #build_access_token ⇒ Object
- #callback_url ⇒ Object
- #request_phase ⇒ Object
Instance Method Details
#authorize_params ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/omniauth/strategies/mercadopago.rb', line 30 def 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 ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 |
# 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= #{} === " 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 ⇒ Object
24 25 26 27 28 |
# 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 |
#request_phase ⇒ Object
20 21 22 |
# File 'lib/omniauth/strategies/mercadopago.rb', line 20 def request_phase super end |