Class: TaxCloud::VerifyAddressService

Inherits:
BaseService show all
Defined in:
lib/service/verify_address_service.rb

Instance Attribute Summary

Attributes inherited from BaseService

#client

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Constructor Details

This class inherits a constructor from TaxCloud::BaseService

Instance Method Details

#verify_address(api_id, api_key, usps_id, address) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/service/verify_address_service.rb', line 7

def verify_address(api_id, api_key, usps_id, address)
  request_params = {
      'apiLoginId' => api_id,
      'apiKey' => api_key,
      'uspsUserID' => usps_id,
      'address1' => address.address1,
      'address2' => address.address2,
      'city' => address.city,
      'state' => address.state,
      'zip5' => address.zip5,
      'zip4' => address.zip4
  }
  response = client.request :verify_address, :body => request_params

  verifyAddressResult = TaxCloud::VerifyAddressResult.new(response.to_hash[:verify_address_response][:verify_address_result])
end