little_finger 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NmRkNDA2NjA5NTExMzVkZWFhODNkNTlmMDNhZjNmMTMxMTRmN2RmOA==
4
+ MjY3MmJiZDgzNmU5NzA2MWY1MGZhM2JhMTQ3ZmZhNjIzZjI2MjU3YQ==
5
5
  data.tar.gz: !binary |-
6
- ZmM2ZTcyMzZkZjMyYWMzNWRkNzBkYTcxNTQ3MjI4ZjY0NWQ3MjIzYQ==
6
+ YzZhOThkNzNhMDZiZWRkZjEwNWU1MGQwZjMwMjkyNTI3ODlmOGFjNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ODIzMWNhYmIzMmY1ZTM2NzBiNjJjMjcxN2ZkZjkwNzljMmYzNGJhNjNiZWZj
10
- NmViNjY2NzIzM2I0MzIyODgyMTljZjgwMmE2NjdhNThjNmJkZDk4ODc1ZmJh
11
- ZTJmNzRmNmEyNGRlZjRhYzU3Njk5NzQ3OWIwOGE5ZmQ3OGY0NDM=
9
+ ZWM0MTU0YWQyN2EzNGE1NTg3YzllOTU3ZjA0ZGIyMWYwODJlNzEwYWVmNjNk
10
+ ZmQzZmZhMjFkNzI0ZTVkMzRlODdjNjZkODNmNzljMGJkOGM1NzJlY2U4M2Uy
11
+ NDA2Nzk1NGRiNzU5ZTRlNmNjYWNkYmJkMjJmMTA2ZDk3ZmM2ZDM=
12
12
  data.tar.gz: !binary |-
13
- ZmFkYTM2YmYzN2ZkZmQ3YTUyODhjMzIxMjViMjlhODQ1NGFlMWIwMDY1YWE3
14
- YjdmMDJiYjRiZDU1YWNmZjFjYjE4YTE4ODNhNTQ4Zjk2NzliNmNjY2NjMjQw
15
- NDBmZWVkMDdiNjBiOGM0ZDIxY2Q2MmUzZGRmYThjZDBiOGFhN2U=
13
+ NWIzOGI3OGEwZjRkOWYyMTY3ODU2YzRmMDYzZGM4N2VlZmI3YmMxN2E5ZmIw
14
+ OThlNGY4NTc1ZWE4NTRhMzQxMDAzMzI2NTcxM2VmNjZlYWMxNmI1NjZjOTcz
15
+ ZjY5NGE5NjkxN2M5MTE5OTNiNDIwMGMyYjEyYjczODM3Njg0Yjg=
@@ -10,6 +10,7 @@ class LittleFinger::Avatax
10
10
  @company_code = LittleFinger::Configuration.configuration[:avatax][:company_code]
11
11
  @account_number = LittleFinger::Configuration.configuration[:avatax][:account_number]
12
12
  @license_key = LittleFinger::Configuration.configuration[:avatax][:license_key]
13
+ @api_timeout = LittleFinger::Configuration.configuration[:avatax][:timeout] || 5
13
14
  @credentials = ["Basic ",Base64.encode64(@account_number + ":"+ @license_key)].join
14
15
  @tax_service_url = [LittleFinger::Configuration.configuration[:avatax][:service_url], LittleFinger::Configuration.configuration[:avatax][:tax_service_path]].join
15
16
  @address_service_url = [LittleFinger::Configuration.configuration[:avatax][:service_url], LittleFinger::Configuration.configuration[:avatax][:address_service_path]].join
@@ -90,7 +91,7 @@ private
90
91
  # @param optional [Hash] custom_headers
91
92
  def send_request(method, uri, payload = {}, custom_headers = {})
92
93
  headers = {authorization: @credentials, content_type: "application/json"}.merge(custom_headers)
93
- RestClient::Request.execute(method: method.to_sym, url: uri, payload: JSON.generate(payload), headers: headers){|response, request, result| response }
94
+ RestClient::Request.execute(method: method.to_sym, url: uri, timeout: @api_timeout, payload: JSON.generate(payload), headers: headers){|response, request, result| response }
94
95
  end
95
96
 
96
- end
97
+ end
@@ -6,4 +6,5 @@ test:
6
6
  license_key: "A1B2C3D4E5F6G7H8"
7
7
  service_url: "https://development.avalara.net"
8
8
  tax_service_path: "/1.0/tax/"
9
- address_service_path: "/1.0/address/"
9
+ address_service_path: "/1.0/address/"
10
+ timeout: 5
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: little_finger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michelle Yung