taxjar-ruby 1.0.0 → 1.0.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 +115 -100
- data/lib/taxjar/tax.rb +1 -1
- data/lib/taxjar/version.rb +1 -1
- 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: 87a190a9235c2a2700a2982818d3140c53523d44
|
4
|
+
data.tar.gz: 33714a826f407017f66354dd8ee292f1c326842d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 370543da7f55ea7307e52ed156cb50eb67c6457d6672df96b4564c41e9d5778c17bc4bb8bcca20a0f3ad21bb8a13bbce683b6bd3bca48d773a92b11055376c6d
|
7
|
+
data.tar.gz: d68ec3c6c5a678fd61ebe39354d06d2d7e0d68b80147531a039d0ac2a229ba948d62f4eef172cff2acdc7e10b741dc12bf84a77f7995bf103d61368b979287b6
|
data/README.md
CHANGED
@@ -1,168 +1,183 @@
|
|
1
|
-
#
|
2
|
-
[![Taxjar](http://www.taxjar.com/img/TJ_logo_color_office_png.png)](http://developers.taxjar.com)
|
1
|
+
# TaxJar Ruby Gem
|
3
2
|
|
4
|
-
|
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
|
+
|
5
|
+
A Ruby interface to the TaxJar API. TaxJar makes sales tax filing easier for online sellers and merchants.
|
5
6
|
See local jurisdictional tax reports, get payment reminders, and more. You can use our API to access TaxJar API endpoints,
|
6
7
|
which can get information on sales tax rates, categories or upload transactions.
|
7
8
|
|
8
|
-
* This wrapper supports 100% of the [
|
9
|
+
* This wrapper supports 100% of the [TaxJar API Version 2](http://developers.taxjar.com/api/#introduction)
|
9
10
|
* Data returned from API calls are mapped into Ruby objects
|
10
11
|
|
11
|
-
|
12
12
|
## Gem Dependencies
|
13
|
+
|
13
14
|
Installing this gem also installs the following gems:
|
14
15
|
|
15
|
-
* [http](https://github.com/httprb/http.rb)
|
16
|
-
* [addressable](https://github.com/sporkmonger/addressable)
|
17
|
-
* [memoizable](https://github.com/dkubb/memoizable) Memoize method return values
|
16
|
+
* [http](https://github.com/httprb/http.rb) Fast Ruby HTTP client with a chainable API and full streaming support.
|
17
|
+
* [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.
|
18
|
+
* [memoizable](https://github.com/dkubb/memoizable) Memoize method return values.
|
18
19
|
|
19
20
|
## Installation
|
20
21
|
|
21
22
|
Add this line to your application's Gemfile:
|
23
|
+
|
22
24
|
```ruby
|
23
|
-
|
25
|
+
gem 'taxjar-ruby', require: 'taxjar'
|
24
26
|
```
|
27
|
+
|
25
28
|
And then execute:
|
29
|
+
|
26
30
|
```shell
|
27
|
-
|
31
|
+
$ bundle install
|
28
32
|
```
|
33
|
+
|
29
34
|
Or install it yourself as:
|
35
|
+
|
30
36
|
```shell
|
31
|
-
|
37
|
+
$ gem install taxjar-ruby
|
32
38
|
```
|
33
|
-
## Quick Start Guide
|
34
39
|
|
35
|
-
|
40
|
+
## Quick Start Guide
|
36
41
|
|
37
|
-
|
42
|
+
First, [get an API key from TaxJar](https://app.taxjar.com/api_sign_up/plus/). Copy and paste in your API key:
|
38
43
|
|
39
44
|
```ruby
|
40
|
-
client = Taxjar::Client.new(api_key:
|
45
|
+
client = Taxjar::Client.new(api_key: 'YOUR KEY')
|
41
46
|
```
|
42
47
|
|
43
|
-
|
44
|
-
You are ready to use Taxjar.
|
48
|
+
You are now ready to use TaxJar!
|
45
49
|
|
46
50
|
## Usage
|
47
51
|
|
48
52
|
### List all tax categories
|
49
53
|
```ruby
|
50
54
|
categories = client.categories
|
51
|
-
|
52
55
|
```
|
56
|
+
|
53
57
|
### List tax rates for a location (by zip/postal code)
|
58
|
+
|
54
59
|
```ruby
|
55
60
|
rates = client.rates_for_location('10001')
|
56
61
|
```
|
57
62
|
|
58
63
|
### Calculate Sales tax for an order
|
64
|
+
|
59
65
|
```ruby
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
66
|
+
order = client.tax_for_order({
|
67
|
+
:to_country => 'US',
|
68
|
+
:to_zip => '90002',
|
69
|
+
:to_city => 'Los Angeles',
|
70
|
+
:to_state => 'CA',
|
71
|
+
:from_country => 'US',
|
72
|
+
:from_zip => '92093',
|
73
|
+
:from_city => 'San Diego',
|
74
|
+
:amount => 16.50,
|
75
|
+
:shipping => 1.5,
|
76
|
+
:line_items => [{:quantity => 1,
|
77
|
+
:product_identifier => '12-34243-9',
|
78
|
+
:unit_price => 15.0,
|
79
|
+
:product_tax_code => 31000}]
|
80
|
+
})
|
74
81
|
```
|
75
82
|
|
76
83
|
### Create order transaction
|
84
|
+
|
77
85
|
```ruby
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
86
|
+
order = client.create_order({
|
87
|
+
:transaction_id => '123',
|
88
|
+
:transaction_date => '2015/05/14',
|
89
|
+
:to_country => 'US',
|
90
|
+
:to_zip => '90002',
|
91
|
+
:to_state => 'CA',
|
92
|
+
:to_city => 'Los Angeles',
|
93
|
+
:to_street => '123 Palm Grove Ln',
|
94
|
+
:amount => 17.45,
|
95
|
+
:shipping => 1.5,
|
96
|
+
:sales_tax => 0.95,
|
97
|
+
:line_items => [{:quantity => 1,
|
98
|
+
:product_identifier => '12-34243-9',
|
99
|
+
:description => 'Fuzzy Widget',
|
100
|
+
:unit_price => 15.0,
|
101
|
+
:sales_tax => 0.95}]
|
102
|
+
})
|
94
103
|
```
|
95
104
|
|
96
105
|
### Update order transaction
|
106
|
+
|
97
107
|
```ruby
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
108
|
+
order = client.update_order({
|
109
|
+
:transaction_id => '123',
|
110
|
+
:amount => 17.95,
|
111
|
+
:shipping => 2.0,
|
112
|
+
:line_items => [{:quantity => 1,
|
113
|
+
:product_identifier => '12-34243-0',
|
114
|
+
:description => 'Heavy Widget',
|
115
|
+
:unit_price => 15.0,
|
116
|
+
:discount => 0.0,
|
117
|
+
:sales_tax => 0.95}]
|
118
|
+
})
|
109
119
|
```
|
110
120
|
|
111
121
|
### Create refund transaction
|
122
|
+
|
112
123
|
```ruby
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
124
|
+
refund = client.create_refund({
|
125
|
+
:transaction_id => '321',
|
126
|
+
:transaction_date => '2015/05/14',
|
127
|
+
:transaction_reference_id => '123',
|
128
|
+
:to_country => 'US',
|
129
|
+
:to_zip => '90002',
|
130
|
+
:to_state => 'CA',
|
131
|
+
:to_city => 'Los Angeles',
|
132
|
+
:to_street => '123 Palm Grove Ln',
|
133
|
+
:amount => 17.45,
|
134
|
+
:shipping => 1.5,
|
135
|
+
:sales_tax => 0.95,
|
136
|
+
:line_items => [{:quantity => 1,
|
137
|
+
:product_identifier => '12-34243-9',
|
138
|
+
:description => 'Fuzzy Widget',
|
139
|
+
:unit_price => 15.0,
|
140
|
+
:sales_tax => 0.95}]
|
141
|
+
})
|
131
142
|
```
|
132
143
|
|
133
144
|
### Update refund transaction
|
145
|
+
|
134
146
|
```ruby
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
147
|
+
refund = client.update_refund{
|
148
|
+
:transaction_id => '321',
|
149
|
+
:amount => 17.95,
|
150
|
+
:shipping => 2.0,
|
151
|
+
:sales_tax => 0.95,
|
152
|
+
:line_items => [{:quantity => 1,
|
153
|
+
:product_identifier => '12-34243-9',
|
154
|
+
:description => 'Heavy Widget',
|
155
|
+
:unit_price => 15.0,
|
156
|
+
:sales_tax => 0.95}]
|
157
|
+
})
|
146
158
|
```
|
159
|
+
|
147
160
|
## Tests
|
148
|
-
An Rspec test suite is available to ensure API functionality:
|
149
161
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
162
|
+
An RSpec test suite is available to ensure API functionality:
|
163
|
+
|
164
|
+
```shell
|
165
|
+
$ git clone git://github.com/taxjar/taxjar-ruby.git
|
166
|
+
$ bundle install
|
167
|
+
$ rspec
|
168
|
+
```
|
155
169
|
|
156
170
|
## More Information
|
157
|
-
|
171
|
+
|
172
|
+
More information can be found on the [TaxJar developer site](http://developers.taxjar.com).
|
158
173
|
|
159
174
|
## License
|
160
|
-
|
161
|
-
License](https://github.com/taxjar/taxjar-ruby/blob/master/LICENSE.txt).
|
175
|
+
|
176
|
+
TaxJar is released under the [MIT License](https://github.com/taxjar/taxjar-ruby/blob/master/LICENSE.txt).
|
162
177
|
|
163
178
|
## Support
|
164
|
-
|
165
|
-
tracking page](https://github.com/taxjar/taxjar-ruby/issues).
|
179
|
+
|
180
|
+
Bug reports and feature requests should be filed on the [GitHub issue tracking page](https://github.com/taxjar/taxjar-ruby/issues).
|
166
181
|
|
167
182
|
## Contributing
|
168
183
|
|
@@ -170,4 +185,4 @@ tracking page](https://github.com/taxjar/taxjar-ruby/issues).
|
|
170
185
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
171
186
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
172
187
|
4. Push to the branch (`git push origin my-new-feature`)
|
173
|
-
5. Create new
|
188
|
+
5. Create new pull request
|
data/lib/taxjar/tax.rb
CHANGED
data/lib/taxjar/version.rb
CHANGED
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.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TaxJar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|