Update qbo.rb

This commit is contained in:
2016-07-28 19:19:13 -04:00
committed by GitHub
parent 36e63995aa
commit 2b7ac05338

View File

@@ -12,17 +12,6 @@ class Qbo < ActiveRecord::Base
unloadable unloadable
validates_presence_of :qb_token, :qb_secret, :company_id, :token_expires_at, :reconnect_token_at validates_presence_of :qb_token, :qb_secret, :company_id, :token_expires_at, :reconnect_token_at
QB_KEY = Setting.plugin_redmine_qbo['settingsOAuthConsumerKey']
QB_SECRET = Setting.plugin_redmine_qbo['settingsOAuthConsumerSecret']
# Quickbooks Config Info
$qb_oauth_consumer = OAuth::Consumer.new(QB_KEY, QB_SECRET, {
:site => "https://oauth.intuit.com",
:request_token_path => "/oauth/v1/get_request_token",
:authorize_url => "https://appcenter.intuit.com/Connect/Begin",
:access_token_path => "/oauth/v1/get_access_token"
})
# Configure quickbooks-ruby-base to access our database # Configure quickbooks-ruby-base to access our database
Quickbooks::Base.configure do |c| Quickbooks::Base.configure do |c|
c.persistent_token = 'qb_token' c.persistent_token = 'qb_token'
@@ -31,7 +20,13 @@ class Qbo < ActiveRecord::Base
end end
def self.get_oauth_consumer def self.get_oauth_consumer
return $qb_oauth_consumer # Quickbooks Config Info
return OAuth::Consumer.new(Setting.plugin_redmine_qbo['settingsOAuthConsumerKey'], Setting.plugin_redmine_qbo['settingsOAuthConsumerSecret'], {
:site => "https://oauth.intuit.com",
:request_token_path => "/oauth/v1/get_request_token",
:authorize_url => "https://appcenter.intuit.com/Connect/Begin",
:access_token_path => "/oauth/v1/get_access_token"
})
end end
# Get a quickbooks base object for type # Get a quickbooks base object for type