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.



5
6
7
# File 'lib/tax_cloud/client.rb', line 5

def initialize
  super wsdl: TaxCloud::WSDL_URL
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.



15
16
17
18
19
# File 'lib/tax_cloud/client.rb', line 15

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.



28
29
30
# File 'lib/tax_cloud/client.rb', line 28

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

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



21
22
23
# File 'lib/tax_cloud/client.rb', line 21

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