taxjar 0.2.0 → 0.2.1

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39a381c8762ddba45978205d3453a9fd223c987f
4
- data.tar.gz: 6a7da0e3e52feb69d62866089c19ca7101bb9480
3
+ metadata.gz: 35ae1bf87f90e449d1eccbd4e68f81deb3de7699
4
+ data.tar.gz: cf6898bcf80634bc26be87dc64f7270178aca39d
5
5
  SHA512:
6
- metadata.gz: 5201dba0ccc0e1beb82005b959665c2ae2761076ff6df66754889763188b0775f25590da6c220e886642f53cc8c66b38e71dbec451061ea8c750e05682c6cadf
7
- data.tar.gz: d0d08b35fac7190e4890992231f6f061fdf7da7653c03680a45e0b10c84c2afc507f57c52b20dfda67997a6b18239505d81989a3d01d0f24df3b84846615f78c
6
+ metadata.gz: 0ed14f1ccafa01ceee2b409a0dfb1f6dd8eea5e3d5242b3a5b0bed50974041a636bcab162ff3f52fcb405364690497f955f9be74f265b0cb80788c8e5bc44b14
7
+ data.tar.gz: c6f6030f719d430eed7b6c5d17cb6ee798a40c184378748935712d9bb4bd16ff6667aa771f1a7f3c882f3abbb04748c40df506756afce96b680452c7245c9f58
data/.gitignore CHANGED
File without changes
data/Gemfile CHANGED
File without changes
File without changes
data/README.md CHANGED
@@ -113,6 +113,17 @@ response = Taxjar.client.update_order_transaction(options)
113
113
  # => {"order":{"transaction_id":"123456","user_id":440,"transaction_date":"2015-06-26T00:00:00Z","from_country":"US","from_zip":"93010","from_state":"CA","from_city":"CAMARILLO","from_street":null,"to_country":"US","to_zip":"07728","to_state":"NJ","to_city":"FREEHOLD","to_street":null,"amount":"10.0","shipping":"2.0","sales_tax":"0.94","line_items":[{"id":1,"quantity":1,"product_identifier":null,"product_tax_code":null,"description":null,"unit_price":"20.0","discount":"0.0","sales_tax":"0.0"}]}}
114
114
  ```
115
115
 
116
+ ### Delete order transaction
117
+ (Enhanced API tier)
118
+
119
+ ```ruby
120
+ options = {
121
+ transaction_id: "123456"
122
+ }
123
+ response = Taxjar.client.delete_order_transaction(options)
124
+ # => {"order":{"transaction_id":"123456","user_id":440,"transaction_date":"2015-06-26T00:00:00Z","from_country":"US","from_zip":"93010","from_state":"CA","from_city":"CAMARILLO","from_street":null,"to_country":"US","to_zip":"07728","to_state":"NJ","to_city":"FREEHOLD","to_street":null,"amount":"10.0","shipping":"2.0","sales_tax":"0.94","line_items":[{"id":1,"quantity":1,"product_identifier":null,"product_tax_code":null,"description":null,"unit_price":"20.0","discount":"0.0","sales_tax":"0.0"}]}}
125
+ ```
126
+
116
127
  ### Create refund transaction
117
128
  (Enhanced API tier)
118
129
 
@@ -153,7 +164,18 @@ options = {
153
164
  sales_tax: 0.94,
154
165
  }
155
166
  response = Taxjar.client.update_refund_transaction(options)
156
- # => {"order":{"transaction_id":"123456","user_id":440,"transaction_date":"2015-06-26T00:00:00Z","from_country":"US","from_zip":"93010","from_state":"CA","from_city":"CAMARILLO","from_street":null,"to_country":"US","to_zip":"07728","to_state":"NJ","to_city":"FREEHOLD","to_street":null,"amount":"10.0","shipping":"2.0","sales_tax":"0.94","line_items":[{"id":1,"quantity":1,"product_identifier":null,"product_tax_code":null,"description":null,"unit_price":"20.0","discount":"0.0","sales_tax":"0.0"}]}}
167
+ # => {"order":{"transaction_id":"REFUND_123456","user_id":440,"transaction_date":"2015-06-26T00:00:00Z","from_country":"US","from_zip":"93010","from_state":"CA","from_city":"CAMARILLO","from_street":null,"to_country":"US","to_zip":"07728","to_state":"NJ","to_city":"FREEHOLD","to_street":null,"amount":"10.0","shipping":"2.0","sales_tax":"0.94","line_items":[{"id":1,"quantity":1,"product_identifier":null,"product_tax_code":null,"description":null,"unit_price":"20.0","discount":"0.0","sales_tax":"0.0"}]}}
168
+ ```
169
+
170
+ ### Delete refund transaction
171
+ (Enhanced API tier)
172
+
173
+ ```ruby
174
+ options = {
175
+ transaction_id: "REFUND_123456"
176
+ }
177
+ response = Taxjar.client.update_refund_transaction(options)
178
+ # => {"order":{"transaction_id":"REFUND_123456","user_id":440,"transaction_date":"2015-06-26T00:00:00Z","from_country":"US","from_zip":"93010","from_state":"CA","from_city":"CAMARILLO","from_street":null,"to_country":"US","to_zip":"07728","to_state":"NJ","to_city":"FREEHOLD","to_street":null,"amount":"10.0","shipping":"2.0","sales_tax":"0.94","line_items":[{"id":1,"quantity":1,"product_identifier":null,"product_tax_code":null,"description":null,"unit_price":"20.0","discount":"0.0","sales_tax":"0.0"}]}}
157
179
  ```
158
180
 
159
181
  ## Contributing
data/Rakefile CHANGED
File without changes
File without changes
File without changes
@@ -57,6 +57,12 @@ module Taxjar
57
57
  response.body
58
58
  end
59
59
 
60
+ def delete_order_transaction(options={})
61
+ check_availability(method_api_version: 2, method_api_tier: 'enhanced')
62
+ response = @conn.delete api_path('transactions', 'orders', options.delete(:transaction_id)), options
63
+ response.body
64
+ end
65
+
60
66
  def create_refund_transaction(options={})
61
67
  check_availability(method_api_version: 2, method_api_tier: 'enhanced')
62
68
  response = @conn.post api_path('transactions', 'refunds'), options
@@ -69,6 +75,12 @@ module Taxjar
69
75
  response.body
70
76
  end
71
77
 
78
+ def delete_refund_transaction(options={})
79
+ check_availability(method_api_version: 2, method_api_tier: 'enhanced')
80
+ response = @conn.delete api_path('transactions', 'refunds', options.delete(:transaction_id)), options
81
+ response.body
82
+ end
83
+
72
84
  private
73
85
 
74
86
  def setup_conn
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module Taxjar
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -4,28 +4,27 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'taxjar/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "taxjar"
7
+ spec.name = 'taxjar'
8
8
  spec.version = Taxjar::VERSION
9
- spec.authors = ["Darren Johnson, Ladislav Marsik"]
10
- spec.email = ["darrenbjohnson@gmail.com, laci.marsik@gmail.com"]
9
+ spec.authors = ['Darren Johnson, Ladislav Marsik']
10
+ spec.email = ['darrenbjohnson@gmail.com, laci.marsik@gmail.com']
11
11
  spec.summary = %q{A Ruby wrapper for the Taxjar API}
12
12
  spec.description = %q{A Ruby wrapper for the Taxjar API's sales tax and tax rate endpoints}
13
- spec.homepage = "http://github.com/djohnson/taxjar"
14
- spec.license = "MIT"
13
+ spec.homepage = 'http://github.com/djohnson/taxjar'
14
+ spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
19
+ spec.require_paths = ['lib']
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.7"
22
- spec.add_development_dependency "rake", "~> 10.0"
23
- spec.add_development_dependency "minitest", "~> 5.0"
21
+ spec.add_development_dependency 'bundler', '~> 1.7'
22
+ spec.add_development_dependency 'rake', '~> 10.0'
23
+ spec.add_development_dependency 'minitest', '~> 5.0'
24
24
  spec.add_development_dependency 'vcr', '~> 2.9', '>= 2.9.0'
25
25
  spec.add_development_dependency 'webmock', '~> 1.20', '>= 1.20.0'
26
26
 
27
- spec.add_runtime_dependency "faraday", ['>= 0.7', '< 0.10']
28
- spec.add_runtime_dependency "faraday_middleware", ['>= 0.8', '< 0.10']
29
- spec.add_runtime_dependency "multi_json", ">= 1.0.3", "~> 1.0"
30
-
27
+ spec.add_runtime_dependency 'faraday', ['>= 0.7', '< 0.10']
28
+ spec.add_runtime_dependency 'faraday_middleware', ['>= 0.8', '< 0.10']
29
+ spec.add_runtime_dependency 'multi_json', '>= 1.0.3', '~> 1.0'
31
30
  end
File without changes
File without changes
@@ -10,7 +10,7 @@ http_interactions:
10
10
  Accept:
11
11
  - application/json; charset=utf-8
12
12
  User-Agent:
13
- - Taxjar ruby Gem 0.1.0
13
+ - Taxjar ruby Gem 0.2.1
14
14
  Authorization:
15
15
  - Token token="dae79dc5154ccabd7cb169f616d605e7"
16
16
  Content-Type:
@@ -10,7 +10,7 @@ http_interactions:
10
10
  Accept:
11
11
  - application/json; charset=utf-8
12
12
  User-Agent:
13
- - Taxjar ruby Gem 0.1.0
13
+ - Taxjar ruby Gem 0.2.1
14
14
  Authorization:
15
15
  - Token token="dae79dc5154ccabd7cb169f616d605e7"
16
16
  Content-Type:
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: delete
5
+ uri: https://api.taxjar.com/v2/enhanced/transactions/orders/123456?amount=10&from_city=Camarillo&from_country=US&from_state=CA&from_zip=93010&line_items%5B%5D%5Bid%5D=123456&line_items%5B%5D%5Bquantity%5D=1&line_items%5B%5D%5Bunit_price%5D=20&sales_tax=0.84&shipping=2&to_city=Freehold&to_country=US&to_state=NJ&to_zip=07728&transaction_date=2015/06/26
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - Taxjar ruby Gem 0.2.1
14
+ Authorization:
15
+ - Token token="dae79dc5154ccabd7cb169f616d605e7"
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - Cowboy
25
+ Connection:
26
+ - keep-alive
27
+ Date:
28
+ - Tue, 11 Oct 2016 09:11:53 GMT
29
+ Content-Type:
30
+ - application/json
31
+ Content-Length:
32
+ - '592'
33
+ Vary:
34
+ - Origin
35
+ Etag:
36
+ - W/"0c2c51613b33f4afcf18027a9855d48c"
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ X-Request-Id:
40
+ - 1f9be91a-69ae-4511-b62c-6fc59e7f941c
41
+ X-Runtime:
42
+ - '0.190184'
43
+ Via:
44
+ - 1.1 vegur
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"order":{"transaction_id":"123456","user_id":440,"transaction_date":"2015-06-26T00:00:00Z","from_country":"US","from_zip":"93010","from_state":"CA","from_city":"CAMARILLO","from_street":null,"to_country":"US","to_zip":"07728","to_state":"NJ","to_city":"FREEHOLD","to_street":null,"amount":"10.0","shipping":"2.0","sales_tax":"0.84","line_items":[{"id":1,"quantity":1,"product_identifier":null,"product_tax_code":null,"description":null,"unit_price":"20.0","discount":"0.0","sales_tax":"0.0"}]}}'
48
+ http_version:
49
+ recorded_at: Tue, 11 Oct 2016 09:11:49 GMT
50
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: delete
5
+ uri: https://api.taxjar.com/v2/enhanced/transactions/refunds/REFUND_123456?amount=10&from_city=Camarillo&from_country=US&from_state=CA&from_zip=93010&line_items%5B%5D%5Bid%5D=123456&line_items%5B%5D%5Bquantity%5D=1&line_items%5B%5D%5Bunit_price%5D=20&sales_tax=0.84&shipping=2&to_city=Freehold&to_country=US&to_state=NJ&to_zip=07728&transaction_date=2015/06/26&transaction_reference_id=123456
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - Taxjar ruby Gem 0.2.1
14
+ Authorization:
15
+ - Token token="dae79dc5154ccabd7cb169f616d605e7"
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - Cowboy
25
+ Connection:
26
+ - keep-alive
27
+ Date:
28
+ - Tue, 11 Oct 2016 09:11:54 GMT
29
+ Content-Type:
30
+ - application/json
31
+ Content-Length:
32
+ - '596'
33
+ Vary:
34
+ - Origin
35
+ Etag:
36
+ - W/"e677b5d8b52c45708fbd020f4197df1f"
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ X-Request-Id:
40
+ - fd95f232-04a1-4cb3-8110-b2743d6b2359
41
+ X-Runtime:
42
+ - '0.115904'
43
+ Via:
44
+ - 1.1 vegur
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"refund":{"transaction_id":"REFUND_123456","user_id":440,"transaction_date":"2015-06-26T00:00:00Z","transaction_reference_id":"123456","from_country":"US","from_zip":"93010","from_state":"CA","from_city":"CAMARILLO","from_street":null,"to_country":"US","to_zip":"07728","to_state":"NJ","to_city":"FREEHOLD","to_street":null,"amount":"10.0","shipping":"2.0","sales_tax":"0.84","line_items":[{"id":1,"quantity":1,"product_identifier":null,"product_tax_code":null,"description":null,"unit_price":"20.0","discount":"0.0","sales_tax":"0.0"}]}}'
48
+ http_version:
49
+ recorded_at: Tue, 11 Oct 2016 09:11:50 GMT
50
+ recorded_with: VCR 3.0.3
@@ -10,7 +10,7 @@ http_interactions:
10
10
  Accept:
11
11
  - application/json; charset=utf-8
12
12
  User-Agent:
13
- - Taxjar ruby Gem 0.1.0
13
+ - Taxjar ruby Gem 0.2.1
14
14
  Authorization:
15
15
  - Token token="dae79dc5154ccabd7cb169f616d605e7"
16
16
  Accept-Encoding:
@@ -10,7 +10,7 @@ http_interactions:
10
10
  Accept:
11
11
  - application/json; charset=utf-8
12
12
  User-Agent:
13
- - Taxjar ruby Gem 0.1.0
13
+ - Taxjar ruby Gem 0.2.1
14
14
  Authorization:
15
15
  - Token token="dae79dc5154ccabd7cb169f616d605e7"
16
16
  Content-Type:
@@ -10,7 +10,7 @@ http_interactions:
10
10
  Accept:
11
11
  - application/json; charset=utf-8
12
12
  User-Agent:
13
- - Taxjar ruby Gem 0.1.0
13
+ - Taxjar ruby Gem 0.2.1
14
14
  Authorization:
15
15
  - Token token="dae79dc5154ccabd7cb169f616d605e7"
16
16
  Content-Type:
@@ -10,7 +10,7 @@ http_interactions:
10
10
  Accept:
11
11
  - application/json; charset=utf-8
12
12
  User-Agent:
13
- - Taxjar ruby Gem 0.1.0
13
+ - Taxjar ruby Gem 0.2.1
14
14
  Authorization:
15
15
  - Token token="dae79dc5154ccabd7cb169f616d605e7"
16
16
  Content-Type:
@@ -10,7 +10,7 @@ http_interactions:
10
10
  Accept:
11
11
  - application/json; charset=utf-8
12
12
  User-Agent:
13
- - Taxjar ruby Gem 0.1.0
13
+ - Taxjar ruby Gem 0.2.1
14
14
  Authorization:
15
15
  - Token token="dae79dc5154ccabd7cb169f616d605e7"
16
16
  Accept-Encoding:
@@ -158,6 +158,15 @@ describe Taxjar::Client do
158
158
  end
159
159
  end
160
160
 
161
+ describe ".delete_order_transaction" do
162
+ it "should delete order transaction" do
163
+ VCR.use_cassette("v2/enhanced/delete_order_transaction") do
164
+ response = Taxjar::Client.new.delete_order_transaction(@options_order_transaction)
165
+ response.must_be :hash
166
+ end
167
+ end
168
+ end
169
+
161
170
  describe ".create_refund_transaction" do
162
171
  it "should create a new refund transaction" do
163
172
  VCR.use_cassette("v2/enhanced/create_refund_transaction") do
@@ -175,6 +184,15 @@ describe Taxjar::Client do
175
184
  end
176
185
  end
177
186
  end
187
+
188
+ describe ".delete_refund_transaction" do
189
+ it "should delete refund transaction" do
190
+ VCR.use_cassette("v2/enhanced/delete_refund_transaction") do
191
+ response = Taxjar::Client.new.delete_refund_transaction(@options_refund_transaction)
192
+ response.must_be :hash
193
+ end
194
+ end
195
+ end
178
196
  end
179
197
  end
180
198
  end
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taxjar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Johnson, Ladislav Marsik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-24 00:00:00.000000000 Z
11
+ date: 2016-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -175,6 +175,8 @@ files:
175
175
  - test/fixtures/v1/tax_rate.yml
176
176
  - test/fixtures/v2/enhanced/create_order_transaction.yml
177
177
  - test/fixtures/v2/enhanced/create_refund_transaction.yml
178
+ - test/fixtures/v2/enhanced/delete_order_transaction.yml
179
+ - test/fixtures/v2/enhanced/delete_refund_transaction.yml
178
180
  - test/fixtures/v2/enhanced/list_categories.yml
179
181
  - test/fixtures/v2/enhanced/update_order_transaction.yml
180
182
  - test/fixtures/v2/enhanced/update_refund_transaction.yml
@@ -204,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
206
  version: '0'
205
207
  requirements: []
206
208
  rubyforge_project:
207
- rubygems_version: 2.4.6
209
+ rubygems_version: 2.2.5
208
210
  signing_key:
209
211
  specification_version: 4
210
212
  summary: A Ruby wrapper for the Taxjar API
@@ -213,6 +215,8 @@ test_files:
213
215
  - test/fixtures/v1/tax_rate.yml
214
216
  - test/fixtures/v2/enhanced/create_order_transaction.yml
215
217
  - test/fixtures/v2/enhanced/create_refund_transaction.yml
218
+ - test/fixtures/v2/enhanced/delete_order_transaction.yml
219
+ - test/fixtures/v2/enhanced/delete_refund_transaction.yml
216
220
  - test/fixtures/v2/enhanced/list_categories.yml
217
221
  - test/fixtures/v2/enhanced/update_order_transaction.yml
218
222
  - test/fixtures/v2/enhanced/update_refund_transaction.yml