vatlayer 0.3.1 → 0.3.2
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 +4 -4
- data/.rubocop.yml +1 -1
- data/README.md +37 -3
- data/lib/vatlayer/api.rb +10 -1
- data/lib/vatlayer/version.rb +1 -1
- data/vatlayer.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8104d7fa89bec8b5084e9b5e437cc140ea8260d
|
4
|
+
data.tar.gz: e40a4ddc0baf1803fbd397c4248150b9e5c9eca9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ad135fb768bcaf0afb2242fcf8d50f18d815f572d6dcaac9509f4aec274035ffe6ed82fdcb9401103e104bcdaf87dbec53bd04db870c1e8c8403ad5e2b11c84
|
7
|
+
data.tar.gz: 6d48b90e8224dec504a9864d1f3b306bfa300130a6df589db00a020e7d65f399708c428369133dbd7c2d44f9f680bd90e4bb3cfcb07b25c9ef1f3d5740d563cb
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[](https://travis-ci.org/drEnilight/vatlayer-ruby) [](https://codecov.io/gh/drEnilight/vatlayer-ruby?branch=master)
|
4
4
|
|
5
|
-
The Ruby gem for accessing the Vatlayer API painlessly, easily
|
5
|
+
The Ruby gem for accessing the Vatlayer API painlessly, easily and awesomely! **Be sure to check the branch for the version you're using.**
|
6
6
|
|
7
7
|
**Important and helpful links:**
|
8
8
|
|
@@ -76,7 +76,26 @@ vatlayer.validate(vat_number: 'LU26375245')
|
|
76
76
|
```
|
77
77
|
|
78
78
|
#### Rate
|
79
|
-
|
79
|
+
```ruby
|
80
|
+
vatlayer.rate(country_code: 'gb')
|
81
|
+
|
82
|
+
# <Vatlayer::Response::Data:0x000055c949f35210
|
83
|
+
# @success=true,
|
84
|
+
# @country_code="GB",
|
85
|
+
# @country_name="United Kingdom",
|
86
|
+
# @standard_rate=20,
|
87
|
+
# @reduced_rates=#<Vatlayer::Response::Data:0x000055c949f344f0
|
88
|
+
# @property_renovations=5,
|
89
|
+
# @foodstuffs=0,
|
90
|
+
# @books=0,
|
91
|
+
# @pharmaceuticals=0,
|
92
|
+
# @medical=0,
|
93
|
+
# @passenger_transport=0,
|
94
|
+
# @newspapers=0,
|
95
|
+
# @childrens_clothing=0>>
|
96
|
+
```
|
97
|
+
|
98
|
+
Also rate method takes parameters like `ip_address`, `use_client_ip`.
|
80
99
|
|
81
100
|
#### Rate list
|
82
101
|
```ruby
|
@@ -100,7 +119,22 @@ vatlayer.rate_list
|
|
100
119
|
```
|
101
120
|
|
102
121
|
#### Price
|
103
|
-
|
122
|
+
```ruby
|
123
|
+
vatlayer.price(amount: 100, country_code: 'GB', options: { type: 'medical' })
|
124
|
+
|
125
|
+
# <Vatlayer::Response::Data:0x00005564aa23e880
|
126
|
+
# @success=true,
|
127
|
+
# @country_code="GB",
|
128
|
+
# @country_name="United Kingdom",
|
129
|
+
# @price_excl_vat=100,
|
130
|
+
# @price_incl_vat=100,
|
131
|
+
# @type="medical",
|
132
|
+
# @vat_rate=0>
|
133
|
+
|
134
|
+
```
|
135
|
+
|
136
|
+
Also price method takes parameters like `ip_address`, `use_client_ip` and optional parameters `type`, `incl`.
|
137
|
+
|
104
138
|
|
105
139
|
### Fetch errors
|
106
140
|
|
data/lib/vatlayer/api.rb
CHANGED
@@ -11,11 +11,20 @@ module Vatlayer
|
|
11
11
|
@https = https
|
12
12
|
end
|
13
13
|
|
14
|
+
def price(amount: nil, country_code: nil, ip_address: nil, use_client_ip: nil, options: {})
|
15
|
+
request('/price', amount: amount, country_code: country_code, ip_address: ip_address,
|
16
|
+
use_client_ip: use_client_ip, type: options[:type], incl: options[:incl])
|
17
|
+
end
|
18
|
+
|
19
|
+
def rate(country_code: nil, ip_address: nil, use_client_ip: nil)
|
20
|
+
request('/rate', country_code: country_code, ip_address: ip_address, use_client_ip: use_client_ip)
|
21
|
+
end
|
22
|
+
|
14
23
|
def rate_list
|
15
24
|
request('/rate_list')
|
16
25
|
end
|
17
26
|
|
18
|
-
def validate(vat_number:)
|
27
|
+
def validate(vat_number: nil)
|
19
28
|
request('/validate', vat_number: vat_number)
|
20
29
|
end
|
21
30
|
|
data/lib/vatlayer/version.rb
CHANGED
data/vatlayer.gemspec
CHANGED
@@ -26,5 +26,5 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency 'rake', '~> 10.0'
|
27
27
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
28
28
|
spec.add_development_dependency 'rubocop', '~> 0.54'
|
29
|
-
spec.required_ruby_version = '>= 2.
|
29
|
+
spec.required_ruby_version = '>= 2.2'
|
30
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vatlayer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vlad Romaniuk
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -129,7 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
129
129
|
requirements:
|
130
130
|
- - ">="
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: '2.
|
132
|
+
version: '2.2'
|
133
133
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
135
|
- - ">="
|