def fetch_access_token(auth_code, options)
      raise ArgumentError, ':redirect_uri required' unless options[:redirect_uri]
      # Exchange the auth code for an access token
      @access_token = @oauth_client.auth_code.get_token(auth_code, options)

      # Use the scope to figure out which merchant we're managing
      scope = @access_token.params[:scope] || @access_token.params['scope']
      set_merchant_id_from_scope(scope)

      self.scoped_access_token
    end
def fetch_access_token(auth_code, options)
      raise ArgumentError, ':redirect_uri required' unless options[:redirect_uri]
      # Exchange the auth code for an access token
      @access_token = @oauth_client.auth_code.get_token(auth_code, options)

      # Use the scope to figure out which merchant we're managing
      scope = @access_token.params[:scope] || @access_token.params['scope']
      set_merchant_id_from_scope(scope)

      self.scoped_access_token
    end
Exchange the authorization code for an access token

 @param [String] auth_code to exchange for the access_token
 @return [String] the access_token required to make API calls to resources