9 Commits

Author SHA1 Message Date
4f789080e7 2.1.0 Bumped wrong versoin 2024-08-19 20:18:22 -04:00
80fc858a35 send back status 200 if request succeeded 2024-08-19 20:14:02 -04:00
6f8d280657 5.2.0 FIXED QBO Authentication 2024-08-19 20:06:13 -04:00
5782cbc166 Added https 2024-08-19 20:04:09 -04:00
0729d2ac41 added https to redirect_uri 2024-08-19 20:02:22 -04:00
6c6de0ba86 Added log 2024-08-19 19:59:26 -04:00
11dbcaf80c Use Setting.host_name & path 2024-08-19 19:53:51 -04:00
95592e542f Use qbo_oauth_callback_path 2024-08-19 19:30:51 -04:00
472bdec4fa Use qbo_authenticate_path 2024-08-19 19:17:45 -04:00
3 changed files with 7 additions and 6 deletions

View File

@@ -26,9 +26,10 @@ class QboController < ApplicationController
# Called when the user requests that Redmine to connect to QBO # Called when the user requests that Redmine to connect to QBO
# #
def authenticate def authenticate
redirect_uri = "https://" + Setting.host_name + qbo_oauth_callback_path
logger.info "redirect_uri: " + redirect_uri
oauth2_client = Qbo.construct_oauth2_client oauth2_client = Qbo.construct_oauth2_client
callback = Setting.host_name + "/qbo/oauth_callback/" grant_url = oauth2_client.auth_code.authorize_url(redirect_uri: redirect_uri, response_type: "code", state: SecureRandom.hex(12), scope: "com.intuit.quickbooks.accounting")
grant_url = oauth2_client.auth_code.authorize_url(redirect_uri: callback, response_type: "code", state: SecureRandom.hex(12), scope: "com.intuit.quickbooks.accounting")
redirect_to grant_url redirect_to grant_url
end end
@@ -39,7 +40,7 @@ class QboController < ApplicationController
if params[:state].present? if params[:state].present?
oauth2_client = Qbo.construct_oauth2_client oauth2_client = Qbo.construct_oauth2_client
# use the state value to retrieve from your backend any information you need to identify the customer in your system # use the state value to retrieve from your backend any information you need to identify the customer in your system
redirect_uri = Setting.host_name + "/qbo/oauth_callback/" redirect_uri = "https://" + Setting.host_name + qbo_oauth_callback_path
if resp = oauth2_client.auth_code.get_token(params[:code], redirect_uri: redirect_uri) if resp = oauth2_client.auth_code.get_token(params[:code], redirect_uri: redirect_uri)
# Remove the last authentication information # Remove the last authentication information
@@ -123,7 +124,7 @@ class QboController < ApplicationController
Qbo.update_time_stamp Qbo.update_time_stamp
# The webhook doesn't require a response but let's make sure we don't send anything # The webhook doesn't require a response but let's make sure we don't send anything
render :nothing => true render :nothing => true, status: 200
else else
render nothing: true, status: 400 render nothing: true, status: 400
end end

View File

@@ -15,7 +15,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<!-- configure the Intuit object: 'grantUrl' is a URL in your application which kicks off the flow, see below --> <!-- configure the Intuit object: 'grantUrl' is a URL in your application which kicks off the flow, see below -->
<script> <script>
intuit.ipp.anywhere.setup({menuProxy: '/path/to/blue-dot', grantUrl: '<%= Setting.host_name %>/qbo/authenticate'}); intuit.ipp.anywhere.setup({menuProxy: '/path/to/blue-dot', grantUrl: '<%= qbo_authenticate_path %>'});
</script> </script>
<table > <table >

View File

@@ -22,7 +22,7 @@ Redmine::Plugin.register :redmine_qbo do
name 'Redmine Quickbooks Online plugin' name 'Redmine Quickbooks Online plugin'
author 'Rick Barrette' author 'Rick Barrette'
description 'This is a plugin for Redmine to intergrate with Quickbooks Online to allow for seamless intergration CRM and invoicing of completed issues' description 'This is a plugin for Redmine to intergrate with Quickbooks Online to allow for seamless intergration CRM and invoicing of completed issues'
version '2.0.5' version '2.1.0'
url 'https://github.com/rickbarrette/redmine_qbo' url 'https://github.com/rickbarrette/redmine_qbo'
author_url 'https://barrettefabrication.com' author_url 'https://barrettefabrication.com'
settings :default => {'empty' => true}, :partial => 'qbo/settings' settings :default => {'empty' => true}, :partial => 'qbo/settings'