def authorize(options)
      extensions = options.delete :extensions
      creds = creds_params(options)
      path = "/transactions/authorize.xml" + options_to_params(options, ALL_PARAMS) + '&' + creds

      headers = extensions_to_header extensions if extensions
      http_response = @http.get(path, headers: headers)

      case http_response
      when Net::HTTPSuccess,Net::HTTPConflict
        build_authorize_response(http_response.body)
      when Net::HTTPClientError
        build_error_response(http_response.body, AuthorizeResponse)
      else
        raise ServerError.new(http_response)
      end
    end
def authorize(options)
      extensions = options.delete :extensions
      creds = creds_params(options)
      path = "/transactions/authorize.xml" + options_to_params(options, ALL_PARAMS) + '&' + creds

      headers = extensions_to_header extensions if extensions
      http_response = @http.get(path, headers: headers)

      case http_response
      when Net::HTTPSuccess,Net::HTTPConflict
        build_authorize_response(http_response.body)
      when Net::HTTPClientError
        build_error_response(http_response.body, AuthorizeResponse)
      else
        raise ServerError.new(http_response)
      end
    end
Authorize an application.

 == Parameters

 Hash with options:

   service_token:: token granting access to the specified service_id.
   app_id::        id of the application to authorize. This is required.
   app_key::       secret key assigned to the application. Required only if application has
                   a key defined.
   service_id::    id of the service (required if you have more than one service)
   user_id::       id of an end user. Required only when the application is rate limiting
                   end users.
   usage::         predicted usage. It is optional. It is a hash where the keys are metrics
                   and the values their predicted usage.
                   Example: {'hits' => 1, 'my_metric' => 100}
   extensions::    Optional. Hash of extension keys and values.

 == Return

 An ThreeScale::AuthorizeResponse object. It's +success?+ method returns true if
 the authorization is successful, false otherwise. It contains additional information
 about the status of the usage. See the ThreeScale::AuthorizeResponse for more information.
 In case of error, the +error_code+ returns code of the error and +error_message+
 human readable error description.

 In case of unexpected internal server error, this method raises a ThreeScale::ServerError
 exception.

 == Examples

   response = client.authorize(:app_id => '1234')

   if response.success?
     # All good. Proceed...
   end