Class: IssueCentre::CustomerConnection

Inherits:
GenericConnection show all
Defined in:
lib/issue_centre/customer_connection.rb

Instance Method Summary collapse

Constructor Details

#initialize(customer_url, session_key, options = {}) ⇒ CustomerConnection

Connection client for authenticating and retrieving customer information from IssueCentre

Parameters:



14
15
16
17
# File 'lib/issue_centre/customer_connection.rb', line 14

def initialize( customer_url, session_key, options = {})
  # @session_key = session_key
  super( customer_url, options)
end

Instance Method Details

#get_companies(session_key, wildcard = '') ⇒ Array

Return companies from IssueCentre for this contract

Parameters:

  • session_key (String)

    SessionKey for this session

  • wildcard (String) (defaults to: '')

    The wildcard used to match the company names. E.g. ‘a*’, ‘Brit?sh’. The wildcard is case insensitive. An empty string will return all companies.

Returns:

  • (Array)

    An array of companies and details as hashes



30
31
32
33
34
35
36
# File 'lib/issue_centre/customer_connection.rb', line 30

def get_companies( session_key, wildcard = '')
  response_xml = self.call( :get_companies, message: {
                              arg0: session_key,
                              arg1: wildcard
                            })
  response = IssueCentre::Response.parse( response_xml)
end

#get_contacts(session_key, company_id = 0, wildcard = '') ⇒ Array

Return contacts from IssueCentre for this contract

Parameters:

  • session_key (String)

    SessionKey for this session

  • company_id (Integer) (defaults to: 0)

    The numeric ID of the company for which to return contacts for. Defaults to returning all contacts for all companies.

  • wildcard (String) (defaults to: '')

    The wildcard used to match the contact names. E.g. ‘Ala?’, ‘Jas*’. The wildcard is case insensitive. An empty string will return all contacts.

Returns:

  • (Array)

    An array of contacts and details as hashes



53
54
55
56
57
58
59
60
# File 'lib/issue_centre/customer_connection.rb', line 53

def get_contacts( session_key, company_id = 0, wildcard = '')
  response_xml = self.call( :get_contacts, message: {
                              arg0: session_key,
                              arg1: company_id,
                              arg2: wildcard
                            })
  response = IssueCentre::Response.parse( response_xml)
end

#get_countries(session_key) ⇒ Array

Return countries from IssueCentre for this contract

Parameters:

  • session_key (String)

    SessionKey for this session

Returns:

  • (Array)

    An array of countries and details as hashes



69
70
71
72
73
74
75
# File 'lib/issue_centre/customer_connection.rb', line 69

def get_countries( session_key)
  response_xml = self.call( :get_countries, message: {
                              arg0: session_key,
                              arg1: ''
                            })
  response = IssueCentre::Response.parse( response_xml)
end