Module: VertexClient

Defined in:
lib/vertex_client.rb,
lib/vertex_client/rates.rb,
lib/vertex_client/railtie.rb,
lib/vertex_client/version.rb,
lib/vertex_client/connection.rb,
lib/vertex_client/configuration.rb,
lib/vertex_client/payloads/base.rb,
lib/vertex_client/resources/base.rb,
lib/vertex_client/responses/base.rb,
lib/vertex_client/payloads/invoice.rb,
lib/vertex_client/payloads/tax_area.rb,
lib/vertex_client/resources/invoice.rb,
lib/vertex_client/responses/invoice.rb,
lib/vertex_client/payloads/quotation.rb,
lib/vertex_client/resources/tax_area.rb,
lib/vertex_client/responses/tax_area.rb,
lib/vertex_client/resources/quotation.rb,
lib/vertex_client/responses/line_item.rb,
lib/vertex_client/responses/quotation.rb,
lib/generators/install/install_generator.rb,
lib/vertex_client/payloads/distribute_tax.rb,
lib/vertex_client/resources/distribute_tax.rb,
lib/vertex_client/responses/distribute_tax.rb,
lib/vertex_client/utils/adjustment_allocator.rb,
lib/vertex_client/payloads/quotation_fallback.rb,
lib/vertex_client/responses/line_item_product.rb,
lib/vertex_client/responses/tax_area_fallback.rb,
lib/vertex_client/responses/quotation_fallback.rb

Defined Under Namespace

Modules: Payload, Resource, Response, Utils Classes: Configuration, Connection, Error, InstallGenerator, Railtie, ServerError, ValidationError

Constant Summary collapse

RATES =
{
  'AL' => '0.0914',
  'AK' => '0.0',
  'AZ' => '0.0',
  'AR' => '0.0',
  'CA' => '0.0856',
  'CO' => '0.0763',
  'CT' => '0.0635',
  'DE' => '0.0',
  'FL' => '0.0705',
  'GA' => '0.0729',
  'HI' => '0.0441',
  'ID' => '0.0603',
  'IL' => '0.0874',
  'IN' => '0.07',
  'IA' => '0.0682',
  'KS' => '0.0',
  'KY' => '0.06',
  'LA' => '0.0945',
  'ME' => '0.055',
  'MD' => '0.06',
  'MA' => '0.0625',
  'MI' => '0.06',
  'MN' => '0.0743',
  'MS' => '0.0707',
  'MO' => '0.0',
  'MT' => '0.0',
  'NE' => '0.0685',
  'NV' => '0.0814',
  'NH' => '0.0',
  'NJ' => '0.066',
  'NM' => '0.0',
  'NY' => '0.0849',
  'NC' => '0.0697',
  'ND' => '0.0685',
  'OH' => '0.0717',
  'OK' => '0.0892',
  'OR' => '0.0',
  'PA' => '0.0634',
  'RI' => '0.07',
  'SC' => '0.0743',
  'SD' => '0.064',
  'TN' => '0.0947',
  'TX' => '0.0819',
  'UT' => '0.0694',
  'VT' => '0.0618',
  'VA' => '0.0565',
  'WA' => '0.0917',
  'WV' => '0.0639',
  'WI' => '0.0544',
  'WY' => '0.0536',
  'DC' => '0.06'
}.freeze
VERSION =
'0.6.7'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



47
48
49
# File 'lib/vertex_client.rb', line 47

def configuration
  @configuration
end

Class Method Details

.circuitObject



78
79
80
81
82
83
84
# File 'lib/vertex_client.rb', line 78

def circuit
  return unless configuration.circuit_config && defined?(Circuitbox)
  Circuitbox.circuit(
    Configuration::CIRCUIT_NAME,
    configuration.circuit_config
  )
end

.configure {|configuration| ... } ⇒ Object

Yields:



58
59
60
# File 'lib/vertex_client.rb', line 58

def configure
  yield(configuration)
end

.distribute_tax(payload) ⇒ Object



70
71
72
# File 'lib/vertex_client.rb', line 70

def distribute_tax(payload)
  Resource::DistributeTax.new(payload).result
end

.invoice(payload) ⇒ Object



66
67
68
# File 'lib/vertex_client.rb', line 66

def invoice(payload)
  Resource::Invoice.new(payload).result
end

.quotation(payload) ⇒ Object



62
63
64
# File 'lib/vertex_client.rb', line 62

def quotation(payload)
  Resource::Quotation.new(payload).result
end

.reconfigure! {|@configuration| ... } ⇒ Object

Yields:



53
54
55
56
# File 'lib/vertex_client.rb', line 53

def reconfigure!
  @configuration = Configuration.new
  yield(@configuration) if block_given?
end

.tax_area(payload) ⇒ Object



74
75
76
# File 'lib/vertex_client.rb', line 74

def tax_area(payload)
  Resource::TaxArea.new(payload).result
end