From 933d1eb7302632b598b0f27a4e02adc6c87df085 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Mon, 1 Aug 2016 15:54:40 -0400 Subject: [PATCH] Update qbo_controller.rb --- app/controllers/qbo_controller.rb | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/app/controllers/qbo_controller.rb b/app/controllers/qbo_controller.rb index 1b9c649..c595089 100644 --- a/app/controllers/qbo_controller.rb +++ b/app/controllers/qbo_controller.rb @@ -34,7 +34,6 @@ class QboController < ApplicationController def authenticate callback = qbo_oauth_callback_url token = Qbo.get_oauth_consumer.get_request_token(:oauth_callback => callback) - #session[:qb_request_token] = token session[:qb_request_token] = Marshal.dump(token) redirect_to("https://appcenter.intuit.com/Connect/Begin?oauth_token=#{token.token}") and return end @@ -43,8 +42,6 @@ class QboController < ApplicationController # Called by QBO after authentication has been processed # def oauth_callback - #at = session[:qb_request_token].get_access_token(:oauth_verifier => params[:oauth_verifier]) - # If Rails >= 4.1 you need to do this => at = Marshal.load(session[:qb_request_token]).get_access_token(:oauth_verifier => params[:oauth_verifier]) #There can only be one... @@ -62,7 +59,6 @@ class QboController < ApplicationController else redirect_to plugin_settings_path(:redmine_qbo), :flash => { :error => "Error" } end - end # Quickbooks Webhook Callback @@ -93,12 +89,12 @@ class QboController < ApplicationController if entity['name'].eql? "Employee" QboEmployee.sync_by_id(entity['id'].to_i) end - - Qbo.update_time_stamp end - - # The webhook doesn't require a response but let's make sure - # we don't send anything + + # Record that last time we updated + Qbo.update_time_stamp + + # The webhook doesn't require a response but let's make sure we don't send anything render :nothing => true end @@ -112,7 +108,6 @@ class QboController < ApplicationController QboEmployee.sync QboEstimate.sync QboInvoice.sync - #QboPurchase.sync # Record the last sync time Qbo.update_time_stamp