taxjar-ruby 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0fa1ef8cd573c3ec624180399c2a29ddccfcc82d
4
- data.tar.gz: dc58878c74697adc26b9750f0a1a64bc4dc38df9
3
+ metadata.gz: 57abdd838dccafdd3d06963feeb4300dcc50cf12
4
+ data.tar.gz: f9bd34f1b42043934a40f340616233165bb45c64
5
5
  SHA512:
6
- metadata.gz: ae413a7c6e7318eb960976f8236095b7e679afcafe241a284d8fdc5ee071a552df1cf87db42ac52afc03dbb39c2e3d3fb3963f7e60ca5825b670dfb8a27cb7ec
7
- data.tar.gz: 2f9acee68886bc4fefe8645c7eca656a337624831df83c30f11f66725dbf36be70e76f18d33e1372aa2338c2a96ca22138b83299c0203aafe4d96fb7d8aa3029
6
+ metadata.gz: 3d40feec61b61684a9041eb88480674a096c75d4b8fce5dd4ab0b33283835cd956d3f9883dcde20e7ca92914bc69702149d18ceb224fef992c3bafe997318570
7
+ data.tar.gz: c985406fd1c1970628252a3a0a769df953db871fd318f03aea8232fb8f7bdfd0e1d3d9511078eb436cc9aecd505b995180534a1be4102960e33978ff3bd14667
@@ -1,3 +1,9 @@
1
+ # 2.3.0 (2018-09-17)
2
+ * Provide access to new jurisdiction names via `tax_for_order`
3
+
4
+ # 2.2.0 (2018-05-02)
5
+ * Support customer exemptions
6
+
1
7
  # 2.1.0 (2018-03-21)
2
8
  * Sandbox environment support with `api_url` and custom headers
3
9
 
@@ -5,6 +5,7 @@ require "taxjar/category"
5
5
  require "taxjar/client"
6
6
  require "taxjar/customer"
7
7
  require "taxjar/exempt_region"
8
+ require "taxjar/jurisdictions"
8
9
  require "taxjar/line_item"
9
10
  require "taxjar/nexus_region"
10
11
  require "taxjar/order"
@@ -0,0 +1,12 @@
1
+ require 'taxjar/base'
2
+
3
+ module Taxjar
4
+ class Jurisdictions < Taxjar::Base
5
+ extend ModelAttribute
6
+
7
+ attribute :country, :string
8
+ attribute :state, :string
9
+ attribute :county, :string
10
+ attribute :city, :string
11
+ end
12
+ end
@@ -13,6 +13,7 @@ module Taxjar
13
13
  attribute :freight_taxable, :boolean
14
14
  attribute :tax_source, :string
15
15
 
16
+ object_attr_reader Taxjar::Jurisdictions, :jurisdictions
16
17
  object_attr_reader Taxjar::Breakdown, :breakdown
17
18
  end
18
19
  end
@@ -6,7 +6,7 @@ module Taxjar
6
6
  end
7
7
 
8
8
  def minor
9
- 2
9
+ 3
10
10
  end
11
11
 
12
12
  def patch
@@ -8,6 +8,12 @@
8
8
  "has_nexus": true,
9
9
  "freight_taxable": true,
10
10
  "tax_source": "destination",
11
+ "jurisdictions": {
12
+ "country": "US",
13
+ "state": "NJ",
14
+ "county": "BERGEN",
15
+ "city": "RAMSEY"
16
+ },
11
17
  "breakdown": {
12
18
  "taxable_amount": 16.5,
13
19
  "tax_collectable": 1.16,
@@ -8,6 +8,10 @@
8
8
  "has_nexus": true,
9
9
  "freight_taxable": true,
10
10
  "tax_source": "destination",
11
+ "jurisdictions": {
12
+ "country": "CA",
13
+ "state": "ON"
14
+ },
11
15
  "breakdown": {
12
16
  "taxable_amount": 26.95,
13
17
  "tax_collectable": 3.5,
@@ -8,6 +8,9 @@
8
8
  "has_nexus": true,
9
9
  "freight_taxable": true,
10
10
  "tax_source": "destination",
11
+ "jurisdictions": {
12
+ "country": "FI"
13
+ },
11
14
  "breakdown": {
12
15
  "taxable_amount": 26.95,
13
16
  "tax_collectable": 6.47,
@@ -125,7 +125,7 @@ describe Taxjar::API do
125
125
  expect(rates.freight_taxable).to eq(true)
126
126
  end
127
127
  end
128
-
128
+
129
129
  describe '#rate_for_location (eu)' do
130
130
  before do
131
131
  @postal_code = "00150"
@@ -192,7 +192,15 @@ describe Taxjar::API do
192
192
  expect(tax.freight_taxable).to eq(true)
193
193
  expect(tax.tax_source).to eq('destination')
194
194
  end
195
-
195
+
196
+ it 'allows access to jurisdictions' do
197
+ tax = @client.tax_for_order(@order)
198
+ expect(tax.jurisdictions.country).to eq('US')
199
+ expect(tax.jurisdictions.state).to eq('NJ')
200
+ expect(tax.jurisdictions.county).to eq('BERGEN')
201
+ expect(tax.jurisdictions.city).to eq('RAMSEY')
202
+ end
203
+
196
204
  it 'allows access to breakdown' do
197
205
  tax = @client.tax_for_order(@order)
198
206
  expect(tax.breakdown.state_taxable_amount).to eq(16.5)
@@ -211,7 +219,7 @@ describe Taxjar::API do
211
219
  expect(tax.breakdown.special_tax_rate).to eq(0)
212
220
  expect(tax.breakdown.special_district_tax_collectable).to eq(0)
213
221
  end
214
-
222
+
215
223
  it 'allows access to breakdown.shipping' do
216
224
  tax = @client.tax_for_order(@order)
217
225
  expect(tax.breakdown.shipping.taxable_amount).to eq(1.5)
@@ -268,7 +276,12 @@ describe Taxjar::API do
268
276
  expect(tax.freight_taxable).to eq(true)
269
277
  expect(tax.tax_source).to eq('destination')
270
278
  end
271
-
279
+
280
+ it 'allows access to jurisdictions' do
281
+ tax = @client.tax_for_order(@order)
282
+ expect(tax.jurisdictions.country).to eq('FI')
283
+ end
284
+
272
285
  it 'allows access to breakdown' do
273
286
  tax = @client.tax_for_order(@order)
274
287
  expect(tax.breakdown.taxable_amount).to eq(26.95)
@@ -278,7 +291,7 @@ describe Taxjar::API do
278
291
  expect(tax.breakdown.country_tax_rate).to eq(0.24)
279
292
  expect(tax.breakdown.country_tax_collectable).to eq(6.47)
280
293
  end
281
-
294
+
282
295
  it 'allows access to breakdown.shipping' do
283
296
  tax = @client.tax_for_order(@order)
284
297
  expect(tax.breakdown.shipping.taxable_amount).to eq(10)
@@ -318,7 +331,13 @@ describe Taxjar::API do
318
331
  expect(tax.freight_taxable).to eq(true)
319
332
  expect(tax.tax_source).to eq('destination')
320
333
  end
321
-
334
+
335
+ it 'allows access to jurisdictions' do
336
+ tax = @client.tax_for_order(@order)
337
+ expect(tax.jurisdictions.country).to eq('CA')
338
+ expect(tax.jurisdictions.state).to eq('ON')
339
+ end
340
+
322
341
  it 'allows access to breakdown' do
323
342
  tax = @client.tax_for_order(@order)
324
343
  expect(tax.breakdown.taxable_amount).to eq(26.95)
@@ -334,7 +353,7 @@ describe Taxjar::API do
334
353
  expect(tax.breakdown.qst_tax_rate).to eq(0)
335
354
  expect(tax.breakdown.qst).to eq(0)
336
355
  end
337
-
356
+
338
357
  it 'allows access to breakdown.shipping' do
339
358
  tax = @client.tax_for_order(@order)
340
359
  expect(tax.breakdown.shipping.taxable_amount).to eq(10)
@@ -369,12 +388,12 @@ describe Taxjar::API do
369
388
  end
370
389
  end
371
390
  end
372
-
391
+
373
392
  describe '#nexus_regions' do
374
393
  before do
375
394
  stub_get('/v2/nexus/regions').to_return(body: fixture('nexus_regions.json'), headers: { content_type: 'application/json; charset=utf-8' })
376
395
  end
377
-
396
+
378
397
  it 'requests the right resource' do
379
398
  @client.nexus_regions
380
399
  expect(a_get('/v2/nexus/regions')).to have_been_made
@@ -390,7 +409,7 @@ describe Taxjar::API do
390
409
  expect(regions.first.region).to eq('California')
391
410
  end
392
411
  end
393
-
412
+
394
413
  describe '#validate' do
395
414
  before do
396
415
  @params = 'vat=FR40303265045'
@@ -418,7 +437,7 @@ describe Taxjar::API do
418
437
  expect(validation.vies_response.address).to eq("11 RUE AMPERE\n26600 PONT DE L ISERE")
419
438
  end
420
439
  end
421
-
440
+
422
441
  describe '#summary_rates' do
423
442
  before do
424
443
  stub_get('/v2/summary_rates').to_return(body: fixture('summary_rates.json'), headers: { content_type: 'application/json; charset=utf-8' })
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taxjar-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - TaxJar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-02 00:00:00.000000000 Z
11
+ date: 2018-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -126,6 +126,7 @@ files:
126
126
  - lib/taxjar/customer.rb
127
127
  - lib/taxjar/error.rb
128
128
  - lib/taxjar/exempt_region.rb
129
+ - lib/taxjar/jurisdictions.rb
129
130
  - lib/taxjar/line_item.rb
130
131
  - lib/taxjar/nexus_region.rb
131
132
  - lib/taxjar/order.rb