Class: QbwcController

Inherits:
ApplicationController
  • Object
show all
Defined in:
lib/generators/qbwc/install/templates/controllers/qbwc_controller.rb

Instance Method Summary collapse

Instance Method Details

#apiObject



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/generators/qbwc/install/templates/controllers/qbwc_controller.rb', line 25

def api
  # respond successfully to a GET which some versions of the Web Connector send to verify the url

  if request.get?
    render :nothing => true
    return
  end

  req = request
  puts "========== #{ params["Envelope"]["Body"].keys.first}  =========="
  res = QBWC::SoapWrapper.route_request(req)
  render :xml => res, :content_type => 'text/xml'
end

#qwcObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/generators/qbwc/install/templates/controllers/qbwc_controller.rb', line 4

def qwc
  qwc = <<-QWC
  <QBWCXML>
  <AppName>#{Rails.application.class.parent_name} #{Rails.env}</AppName>
  <AppID></AppID>
  <AppURL>#{quickbooks_url(:protocol => 'https://', :action => 'api')}</AppURL>
  <AppDescription>I like to describe my awesome app</AppDescription>
  <AppSupport>#{QBWC.support_site_url}</AppSupport>
  <UserName>#{QBWC.username}</UserName>
  <OwnerID>#{QBWC.owner_id}</OwnerID>
  <FileID>{90A44FB5-33D9-4815-AC85-BC87A7E7D1EB}</FileID>
  <QBType>QBFS</QBType>
  <Style>Document</Style>
  <Scheduler>
    <RunEveryNMinutes>5</RunEveryNMinutes>
  </Scheduler>
  </QBWCXML>
  QWC
  send_data qwc, :filename => 'name_me.qwc'
end