mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 08:54:23 -05:00
Compare commits
9 Commits
c7a313e9ed
...
4f789080e7
| Author | SHA1 | Date | |
|---|---|---|---|
| 4f789080e7 | |||
| 80fc858a35 | |||
| 6f8d280657 | |||
| 5782cbc166 | |||
| 0729d2ac41 | |||
| 6c6de0ba86 | |||
| 11dbcaf80c | |||
| 95592e542f | |||
| 472bdec4fa |
@@ -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
|
||||||
|
|||||||
@@ -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 >
|
||||||
|
|||||||
2
init.rb
2
init.rb
@@ -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'
|
||||||
|
|||||||
Reference in New Issue
Block a user