taxjar-ruby 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -15
- data/lib/taxjar/line_item.rb +1 -0
- data/lib/taxjar/version.rb +1 -1
- data/spec/fixtures/order.json +1 -0
- data/spec/fixtures/refund.json +1 -0
- data/spec/taxjar/api/order_spec.rb +12 -1
- data/spec/taxjar/api/refund_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9eb2e7131efcdba8714c438b63ef315fcca25ef
|
4
|
+
data.tar.gz: c7b76ae3a307b72a1d0a6c330deb4c5c1a62ac00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 985a2137521594703c2b5cdcad7e83ed4e7a49d7a9c8045daa9cbe771dc0fe5c9366bd62b50aab3a118124bbf7292355d79264db1cadf510a57242b7ece06ff4
|
7
|
+
data.tar.gz: 05d505aa344cf7547232121239e4c10e3f07b520839fc25a1f75984458d8bb90c9d40db71b290308f9fce49f0e5605dd36722bb5ead753701c06af19621ba35b
|
data/README.md
CHANGED
@@ -1,13 +1,12 @@
|
|
1
|
-
# TaxJar Ruby
|
1
|
+
# TaxJar Sales Tax API for Ruby [![RubyGems](http://img.shields.io/gem/v/taxjar-ruby.svg?style=flat-square)](https://rubygems.org/gems/taxjar-ruby) [![Build Status](http://img.shields.io/travis/taxjar/taxjar-ruby.svg?style=flat-square)](https://travis-ci.org/taxjar/taxjar-ruby)
|
2
2
|
|
3
3
|
<a href="http://developers.taxjar.com"><img src="http://www.taxjar.com/img/TJ_logo_color_office_png.png" alt="TaxJar" width="220"></a>
|
4
4
|
|
5
|
-
A Ruby interface to the TaxJar Sales Tax API. TaxJar makes sales tax filing easier for online sellers and merchants.
|
6
|
-
See local jurisdictional tax reports, get payment reminders, and more. You can use our API to access TaxJar API endpoints,
|
7
|
-
which can get information on sales tax rates, categories or upload transactions.
|
5
|
+
A Ruby interface to the TaxJar [Sales Tax API](https://developers.taxjar.com/api/reference/). TaxJar makes sales tax filing easier for online sellers and merchants.
|
6
|
+
See local jurisdictional tax reports, get payment reminders, and more. You can use our API to access TaxJar API endpoints, which can get information on sales tax rates, categories or upload transactions.
|
8
7
|
|
9
|
-
* This wrapper supports 100% of
|
10
|
-
* Data returned from API calls are mapped
|
8
|
+
* This wrapper supports 100% of [SmartCalcs v2](http://developers.taxjar.com/api/#introduction)
|
9
|
+
* Data returned from API calls are mapped to Ruby objects
|
11
10
|
|
12
11
|
## Supported Ruby Versions
|
13
12
|
|
@@ -15,12 +14,12 @@ Ruby 1.9.3 or greater
|
|
15
14
|
|
16
15
|
## Gem Dependencies
|
17
16
|
|
18
|
-
Installing this gem also
|
17
|
+
Installing this gem also bundles the following dependencies:
|
19
18
|
|
20
|
-
* [http](https://github.com/httprb/http.rb) Fast Ruby HTTP client with a chainable API and full streaming support.
|
21
|
-
* [addressable](https://github.com/sporkmonger/addressable) Replacement for the URI implementation that is part of Ruby's standard library. It more closely conforms to the relevant RFCs and adds support for IRIs and URI templates.
|
22
|
-
* [memoizable](https://github.com/dkubb/memoizable) Memoize method return values.
|
23
|
-
* [model_attribute](https://github.com/yammer/model_attribute) Type casted attributes for non-ActiveRecord models. [Forked](https://github.com/taxjar/model_attribute) to handle floats and more types.
|
19
|
+
* [http](https://github.com/httprb/http.rb) - Fast Ruby HTTP client with a chainable API and full streaming support.
|
20
|
+
* [addressable](https://github.com/sporkmonger/addressable) - Replacement for the URI implementation that is part of Ruby's standard library. It more closely conforms to the relevant RFCs and adds support for IRIs and URI templates.
|
21
|
+
* [memoizable](https://github.com/dkubb/memoizable) - Memoize method return values.
|
22
|
+
* [model_attribute](https://github.com/yammer/model_attribute) - Type casted attributes for non-ActiveRecord models. [Forked](https://github.com/taxjar/model_attribute) to handle floats and more types.
|
24
23
|
|
25
24
|
## Installation
|
26
25
|
|
@@ -42,11 +41,16 @@ Or install it yourself as:
|
|
42
41
|
$ gem install taxjar-ruby
|
43
42
|
```
|
44
43
|
|
45
|
-
##
|
44
|
+
## Authentication
|
46
45
|
|
47
|
-
|
46
|
+
[Generate an API token from TaxJar](https://app.taxjar.com/api_sign_up/). Copy and paste your API token when instantiating a new client:
|
48
47
|
|
49
|
-
|
48
|
+
```ruby
|
49
|
+
require 'taxjar'
|
50
|
+
client = Taxjar::Client.new(api_key: 'YOUR_API_TOKEN')
|
51
|
+
```
|
52
|
+
|
53
|
+
You're now ready to use TaxJar! [Check out our quickstart guide](https://developers.taxjar.com/api/guides/ruby/#ruby-quickstart) to get up and running quickly.
|
50
54
|
|
51
55
|
## Usage
|
52
56
|
|
@@ -946,7 +950,7 @@ $ rspec
|
|
946
950
|
|
947
951
|
## More Information
|
948
952
|
|
949
|
-
More information can be found on
|
953
|
+
More information can be found on [TaxJar Developers](http://developers.taxjar.com).
|
950
954
|
|
951
955
|
## License
|
952
956
|
|
data/lib/taxjar/line_item.rb
CHANGED
data/lib/taxjar/version.rb
CHANGED
data/spec/fixtures/order.json
CHANGED
data/spec/fixtures/refund.json
CHANGED
@@ -89,7 +89,9 @@ describe Taxjar::API::Order do
|
|
89
89
|
expect(order.line_items[0].quantity).to eq(1)
|
90
90
|
expect(order.line_items[0].product_identifier).to eq('12-34243-9')
|
91
91
|
expect(order.line_items[0].description).to eq('Fuzzy Widget')
|
92
|
+
expect(order.line_items[0].product_tax_code).to eq('20010')
|
92
93
|
expect(order.line_items[0].unit_price).to eq(15.0)
|
94
|
+
expect(order.line_items[0].discount).to eq(0.0)
|
93
95
|
expect(order.line_items[0].sales_tax).to eq(0.95)
|
94
96
|
end
|
95
97
|
end
|
@@ -112,7 +114,9 @@ describe Taxjar::API::Order do
|
|
112
114
|
:quantity => 1,
|
113
115
|
:product_identifier => '12-34243-9',
|
114
116
|
:description => 'Fuzzy Widget',
|
117
|
+
:product_tax_code => '20010',
|
115
118
|
:unit_price => 15.0,
|
119
|
+
:discount => 0.0,
|
116
120
|
:sales_tax => 0.95}]
|
117
121
|
}
|
118
122
|
end
|
@@ -149,7 +153,9 @@ describe Taxjar::API::Order do
|
|
149
153
|
expect(order.line_items[0].quantity).to eq(1)
|
150
154
|
expect(order.line_items[0].product_identifier).to eq('12-34243-9')
|
151
155
|
expect(order.line_items[0].description).to eq('Fuzzy Widget')
|
156
|
+
expect(order.line_items[0].product_tax_code).to eq('20010')
|
152
157
|
expect(order.line_items[0].unit_price).to eq(15.0)
|
158
|
+
expect(order.line_items[0].discount).to eq(0.0)
|
153
159
|
expect(order.line_items[0].sales_tax).to eq(0.95)
|
154
160
|
end
|
155
161
|
end
|
@@ -166,7 +172,8 @@ describe Taxjar::API::Order do
|
|
166
172
|
:line_items => [{:id => 1,
|
167
173
|
:quantity => 1,
|
168
174
|
:product_identifier => '12-34243-0',
|
169
|
-
:description => 'Heavy
|
175
|
+
:description => 'Heavy Widget',
|
176
|
+
:product_tax_code => '20010',
|
170
177
|
:unit_price => 15.0,
|
171
178
|
:discount => 0.0,
|
172
179
|
:sales_tax => 0.95}]
|
@@ -205,7 +212,9 @@ describe Taxjar::API::Order do
|
|
205
212
|
expect(order.line_items[0].quantity).to eq(1)
|
206
213
|
expect(order.line_items[0].product_identifier).to eq('12-34243-9')
|
207
214
|
expect(order.line_items[0].description).to eq('Fuzzy Widget')
|
215
|
+
expect(order.line_items[0].product_tax_code).to eq('20010')
|
208
216
|
expect(order.line_items[0].unit_price).to eq(15.0)
|
217
|
+
expect(order.line_items[0].discount).to eq(0.0)
|
209
218
|
expect(order.line_items[0].sales_tax).to eq(0.95)
|
210
219
|
end
|
211
220
|
end
|
@@ -249,7 +258,9 @@ describe Taxjar::API::Order do
|
|
249
258
|
expect(order.line_items[0].quantity).to eq(1)
|
250
259
|
expect(order.line_items[0].product_identifier).to eq('12-34243-9')
|
251
260
|
expect(order.line_items[0].description).to eq('Fuzzy Widget')
|
261
|
+
expect(order.line_items[0].product_tax_code).to eq('20010')
|
252
262
|
expect(order.line_items[0].unit_price).to eq(15.0)
|
263
|
+
expect(order.line_items[0].discount).to eq(0.0)
|
253
264
|
expect(order.line_items[0].sales_tax).to eq(0.95)
|
254
265
|
end
|
255
266
|
end
|
@@ -90,6 +90,7 @@ describe Taxjar::API::Refund do
|
|
90
90
|
expect(refund.line_items[0].quantity).to eq(1)
|
91
91
|
expect(refund.line_items[0].product_identifier).to eq('12-34243-9')
|
92
92
|
expect(refund.line_items[0].description).to eq('Fuzzy Widget')
|
93
|
+
expect(refund.line_items[0].product_tax_code).to eq('20010')
|
93
94
|
expect(refund.line_items[0].unit_price).to eq(15.0)
|
94
95
|
expect(refund.line_items[0].discount).to eq(0.0)
|
95
96
|
expect(refund.line_items[0].sales_tax).to eq(0.95)
|
@@ -115,7 +116,9 @@ describe Taxjar::API::Refund do
|
|
115
116
|
:line_items => [{:quantity => 1,
|
116
117
|
:product_identifier => '12-34243-9',
|
117
118
|
:description => 'Fuzzy Widget',
|
119
|
+
:product_tax_code => '20010',
|
118
120
|
:unit_price => 15.0,
|
121
|
+
:discount => 0.0,
|
119
122
|
:sales_tax => 0.95}]
|
120
123
|
}
|
121
124
|
end
|
@@ -153,6 +156,7 @@ describe Taxjar::API::Refund do
|
|
153
156
|
expect(refund.line_items[0].quantity).to eq(1)
|
154
157
|
expect(refund.line_items[0].product_identifier).to eq('12-34243-9')
|
155
158
|
expect(refund.line_items[0].description).to eq('Fuzzy Widget')
|
159
|
+
expect(refund.line_items[0].product_tax_code).to eq('20010')
|
156
160
|
expect(refund.line_items[0].unit_price).to eq(15.0)
|
157
161
|
expect(refund.line_items[0].discount).to eq(0.0)
|
158
162
|
expect(refund.line_items[0].sales_tax).to eq(0.95)
|
@@ -172,7 +176,9 @@ describe Taxjar::API::Refund do
|
|
172
176
|
:line_items => [{:quantity => 1,
|
173
177
|
:product_identifier => '12-34243-9',
|
174
178
|
:description => 'Heavy Widget',
|
179
|
+
:product_tax_code => '20010',
|
175
180
|
:unit_price => 15.0,
|
181
|
+
:discount => 0.0,
|
176
182
|
:sales_tax => 0.95}]
|
177
183
|
}
|
178
184
|
end
|
@@ -210,6 +216,7 @@ describe Taxjar::API::Refund do
|
|
210
216
|
expect(refund.line_items[0].quantity).to eq(1)
|
211
217
|
expect(refund.line_items[0].product_identifier).to eq('12-34243-9')
|
212
218
|
expect(refund.line_items[0].description).to eq('Fuzzy Widget')
|
219
|
+
expect(refund.line_items[0].product_tax_code).to eq('20010')
|
213
220
|
expect(refund.line_items[0].unit_price).to eq(15.0)
|
214
221
|
expect(refund.line_items[0].discount).to eq(0.0)
|
215
222
|
expect(refund.line_items[0].sales_tax).to eq(0.95)
|
@@ -256,6 +263,7 @@ describe Taxjar::API::Refund do
|
|
256
263
|
expect(refund.line_items[0].quantity).to eq(1)
|
257
264
|
expect(refund.line_items[0].product_identifier).to eq('12-34243-9')
|
258
265
|
expect(refund.line_items[0].description).to eq('Fuzzy Widget')
|
266
|
+
expect(refund.line_items[0].product_tax_code).to eq('20010')
|
259
267
|
expect(refund.line_items[0].unit_price).to eq(15.0)
|
260
268
|
expect(refund.line_items[0].discount).to eq(0.0)
|
261
269
|
expect(refund.line_items[0].sales_tax).to eq(0.95)
|
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: 1.7.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TaxJar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|