Class: TaxCloud::Client

Inherits:
Savon::Client
  • Object
show all
Defined in:
lib/tax_cloud/client.rb

Overview

A Client communicates with the TaxCloud service.

Instance Method Summary collapse

Constructor Details

#initializeClient

Create a new client.



7
8
9
# File 'lib/tax_cloud/client.rb', line 7

def initialize
  super client_params
end

Instance Method Details

#call(method, message = {}) ⇒ Object

Make a safe SOAP call. Will raise a TaxCloud::Errors::SoapError on error.

Parameters

method

SOAP method.

body

Body content.



17
18
19
20
21
# File 'lib/tax_cloud/client.rb', line 17

def call(method, message = {})
  safe do
    super method, message: message.merge(auth_params)
  end
end

#pingObject

Ping the TaxCloud service.

Returns “OK” or raises an error if the TaxCloud service is unreachable.



30
31
32
# File 'lib/tax_cloud/client.rb', line 30

def ping
  TaxCloud::Responses::Ping.parse request(:ping)
end

#request(method, message = {}) ⇒ Object



23
24
25
# File 'lib/tax_cloud/client.rb', line 23

def request(method, message = {})
  call method, message
end