Class: Quickbooks::Service::AccessToken

Inherits:
BaseService show all
Defined in:
lib/quickbooks/service/access_token.rb

Constant Summary collapse

RENEW_URL =
"https://appcenter.intuit.com/api/v1/connection/reconnect"
DISCONNECT_URL =
"https://appcenter.intuit.com/api/v1/connection/disconnect"

Constants inherited from BaseService

BaseService::BASE_DOMAIN, BaseService::HTTP_ACCEPT, BaseService::HTTP_ACCEPT_ENCODING, BaseService::HTTP_CONTENT_TYPE, BaseService::SANDBOX_DOMAIN, BaseService::XML_NS

Instance Attribute Summary

Attributes inherited from BaseService

#base_uri, #company_id, #last_response_body, #last_response_xml, #oauth

Instance Method Summary collapse

Methods inherited from BaseService

#access_token=, #default_model_query, #initialize, #realm_id=, #url_for_base, #url_for_query, #url_for_resource

Methods included from ServiceCrud

#create, #delete, #delete_by_query_string, #fetch_by_id, #query, #query_in_batches

Methods included from Util::Logging

#log, #log_xml

Constructor Details

This class inherits a constructor from Quickbooks::Service::BaseService

Instance Method Details

#disconnectObject



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/quickbooks/service/access_token.rb', line 23

def disconnect
  result = nil
  response = do_http_get(DISCONNECT_URL)
  if response
    code = response.code.to_i
    if code == 200
      result = Quickbooks::Model::AccessTokenResponse.from_xml(response.plain_body)
    end
  end

  result
end

#renewObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/quickbooks/service/access_token.rb', line 9

def renew
  result = nil
  response = do_http_get(RENEW_URL)
  if response
    code = response.code.to_i
    if code == 200
      result = Quickbooks::Model::AccessTokenResponse.from_xml(response.plain_body)
    end
  end

  result
end