Skip to content

Commit 3fd035e

Browse files
committed
include "ousted" actionwebservice in vendor/ and copy into vendor/gems
include action_web_service_ext to allow the QBWC to "check" status of service using HTTP GET
1 parent 4ba8536 commit 3fd035e

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

README.markdown

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,28 @@ To implement your own QuickBooks integration, implement the functions outlined i
2121

2222
### Requirements ###
2323

24-
1) Install actionwebservice gem (if it's not already installed)
25-
26-
sudo gem install actionwebservice
27-
28-
2) Add a route for the qbwc controller to config/routes.rb
24+
1) Add a route for the qbwc controller to config/routes.rb
2925

3026
# example Quickbooks Web Connector api route
3127
map.quickbooks_api 'apis/quickbooks/api', :controller => 'qbwc', :action => 'api'
32-
33-
3) The QBWC will only communicate over SSL so make sure your app has a valid and trusted SSL cert installed. For testing the QBWC will speak to localhost over http.
28+
29+
2) Add the following block to config/environment.rb
30+
31+
Rails::Initializer.run do |config|
32+
...
33+
config.load_paths += %W( #{RAILS_ROOT}/app/apis )
34+
config.load_paths += Dir["#{RAILS_ROOT}/vendor/gems/**"].map do |dir|
35+
File.directory?(lib = "#{dir}/lib") ? lib : dir
36+
end
37+
...
38+
end
39+
40+
3) Add the following lines to an initializer or the bottom of config/environment.rb
41+
42+
require 'actionwebservice'
43+
require 'action_web_service_ext'
44+
45+
4) The QBWC will only communicate over SSL so make sure your app has a valid and trusted SSL cert installed. For testing the QBWC will speak to localhost over http.
3446

3547
### Installation ###
3648

install.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@ def safe_copy(src, dest)
1212
app_root = File.join(plugin_root, '../../../')
1313

1414
FileUtils.mkdir_p File.join(app_root, 'app/apis'), :verbose => true
15+
FileUtils.mkdir_p File.join(app_root, 'vendor/gems'), :verbose => true
16+
1517
safe_copy File.join(plugin_root, 'templates/example_qbwc_controller.rb'), File.join(app_root, 'app/controllers/qbwc_controller.rb')
1618
safe_copy File.join(plugin_root, 'templates/example_qbwc_helper.rb'), File.join(app_root, 'app/helpers/qbwc_helper.rb')
1719
safe_copy File.join(plugin_root, 'templates/example_qbwc_api.rb'), File.join(app_root, 'app/apis/qbwc_api.rb')
1820
safe_copy File.join(plugin_root, 'templates/example_qbwc_controller_test.rb'), File.join(app_root, 'test/functional/qbwc_controller_test.rb')
1921
safe_copy File.join(plugin_root, 'templates/example_qbwc.qwc'), File.join(app_root, 'config/qbwc.qwc')
22+
safe_copy File.join(plugin_root, 'lib/action_web_service_ext.rb'), File.join(app_root, 'lib/action_web_service_ext.rb')
23+
24+
FileUtils.cp_r File.join(plugin_root, 'vendor/actionwebservice'), File.join(app_root, 'vendor/gems/actionwebservice'), :preserve => true, :verbose => true
2025

2126
puts IO.read(File.join(File.dirname(__FILE__), 'README.markdown'))

templates/example_qbwc.qwc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
<AppDescription>QuickBooks Plugin Example</AppDescription>
66
<AppSupport>http://idnforums.intuit.com/</AppSupport>
77
<UserName>CHANGME</UserName>
8-
<OwnerID></OwnerID>
9-
<FileID></FileID>
8+
<!-- OwnerID and FileID should be unique GUIDs - you can change these values for your app -->
9+
<OwnerID>{91F3B9B4-34F1-4fcc-B1EE-566DE1813D20}</OwnerID>
10+
<FileID>bc1286156fa27ecb6ae6d3ae6c96e12193aaf63f</FileID>
1011
<QBType>QBFS</QBType>
1112
<Style>RPC</Style>
1213
</QBWCXML>

0 commit comments

Comments
 (0)