valvat 0.8.1 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.gitignore +2 -1
- data/.travis.yml +30 -16
- data/CHANGES.md +45 -2
- data/Gemfile +2 -3
- data/README.md +96 -46
- data/certs/yolk.pem +24 -20
- data/gemfiles/activemodel-3-2 +3 -4
- data/gemfiles/activemodel-4 +3 -4
- data/gemfiles/activemodel-5 +4 -5
- data/gemfiles/activemodel-6 +7 -0
- data/gemfiles/before-ruby21/activemodel-3-2 +3 -4
- data/gemfiles/before-ruby21/activemodel-4 +3 -4
- data/gemfiles/before-ruby21/standalone +3 -4
- data/gemfiles/standalone +3 -5
- data/lib/active_model/validations/valvat_validator.rb +20 -5
- data/lib/valvat.rb +3 -1
- data/lib/valvat/checksum/gb.rb +30 -13
- data/lib/valvat/checksum/ie.rb +1 -1
- data/lib/valvat/checksum/nl.rb +5 -0
- data/lib/valvat/checksum/si.rb +2 -2
- data/lib/valvat/error.rb +28 -0
- data/lib/valvat/local.rb +2 -1
- data/lib/valvat/locales/en.yml +1 -1
- data/lib/valvat/locales/fr.yml +17 -17
- data/lib/valvat/locales/pt.yml +28 -28
- data/lib/valvat/lookup.rb +11 -43
- data/lib/valvat/lookup/fault.rb +30 -0
- data/lib/valvat/lookup/request.rb +33 -12
- data/lib/valvat/lookup/response.rb +36 -0
- data/lib/valvat/utils.rb +11 -3
- data/lib/valvat/version.rb +1 -1
- data/spec/active_model/validations/valvat_validator_spec.rb +92 -66
- data/spec/valvat/checksum/at_spec.rb +2 -2
- data/spec/valvat/checksum/be_spec.rb +2 -2
- data/spec/valvat/checksum/bg_spec.rb +2 -2
- data/spec/valvat/checksum/cy_spec.rb +2 -2
- data/spec/valvat/checksum/de_spec.rb +2 -2
- data/spec/valvat/checksum/dk_spec.rb +2 -2
- data/spec/valvat/checksum/ee_spec.rb +2 -2
- data/spec/valvat/checksum/es_spec.rb +2 -2
- data/spec/valvat/checksum/fi_spec.rb +2 -2
- data/spec/valvat/checksum/fr_spec.rb +2 -2
- data/spec/valvat/checksum/gb_spec.rb +5 -3
- data/spec/valvat/checksum/gr_spec.rb +2 -2
- data/spec/valvat/checksum/hr_spec.rb +2 -2
- data/spec/valvat/checksum/hu_spec.rb +2 -2
- data/spec/valvat/checksum/ie_spec.rb +8 -2
- data/spec/valvat/checksum/it_spec.rb +4 -4
- data/spec/valvat/checksum/lt_spec.rb +2 -2
- data/spec/valvat/checksum/lu_spec.rb +2 -2
- data/spec/valvat/checksum/mt_spec.rb +2 -2
- data/spec/valvat/checksum/nl_spec.rb +4 -4
- data/spec/valvat/checksum/pl_spec.rb +3 -3
- data/spec/valvat/checksum/pt_spec.rb +2 -2
- data/spec/valvat/checksum/ro_spec.rb +2 -2
- data/spec/valvat/checksum/se_spec.rb +3 -3
- data/spec/valvat/checksum/si_spec.rb +7 -7
- data/spec/valvat/checksum_spec.rb +2 -2
- data/spec/valvat/lockup/fault_spec.rb +32 -0
- data/spec/valvat/lockup/request_spec.rb +15 -0
- data/spec/valvat/lockup/response_spec.rb +27 -0
- data/spec/valvat/lookup_spec.rb +168 -35
- data/spec/valvat/syntax_spec.rb +29 -29
- data/spec/valvat/utils_spec.rb +28 -8
- data/spec/valvat_spec.rb +18 -18
- data/valvat.gemspec +1 -0
- metadata +52 -25
- metadata.gz.sig +0 -0
- data/lib/valvat/lookup/request_with_id.rb +0 -31
data/spec/valvat/utils_spec.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
require 'spec_helper'
|
2
3
|
|
3
4
|
describe Valvat::Utils do
|
4
5
|
describe "#split" do
|
5
|
-
it "returns country and rest on
|
6
|
+
it "returns country and rest on VAT number as array" do
|
6
7
|
expect(Valvat::Utils.split("DE345889003")).to eql(["DE", "345889003"])
|
7
8
|
expect(Valvat::Utils.split("ESX4588900X")).to eql(["ES", "X4588900X"])
|
8
9
|
end
|
@@ -26,18 +27,18 @@ describe Valvat::Utils do
|
|
26
27
|
end
|
27
28
|
|
28
29
|
describe "#normalize" do
|
29
|
-
it "returns
|
30
|
+
it "returns VAT number with upcase chars" do
|
30
31
|
expect(Valvat::Utils.normalize("de345889003")).to eql("DE345889003")
|
31
32
|
expect(Valvat::Utils.normalize("EsX4588900y")).to eql("ESX4588900Y")
|
32
33
|
end
|
33
34
|
|
34
|
-
it "returns trimmed
|
35
|
+
it "returns trimmed VAT number" do
|
35
36
|
expect(Valvat::Utils.normalize(" DE345889003")).to eql("DE345889003")
|
36
37
|
expect(Valvat::Utils.normalize(" DE345889003 ")).to eql("DE345889003")
|
37
38
|
expect(Valvat::Utils.normalize("DE345889003 ")).to eql("DE345889003")
|
38
39
|
end
|
39
40
|
|
40
|
-
it "does not change already normalized
|
41
|
+
it "does not change already normalized VAT numbers" do
|
41
42
|
expect(Valvat::Utils.normalize("DE345889003")).to eql("DE345889003")
|
42
43
|
expect(Valvat::Utils.normalize("ESX4588900X")).to eql("ESX4588900X")
|
43
44
|
end
|
@@ -49,6 +50,7 @@ describe Valvat::Utils do
|
|
49
50
|
|
50
51
|
it "removes special chars" do
|
51
52
|
expect(Valvat::Utils.normalize("DE.345-889_00:3,;")).to eql("DE345889003")
|
53
|
+
expect(Valvat::Utils.normalize("→ DE·Ö34588 9003\0 ☺")).to eql("→DEÖ345889003☺")
|
52
54
|
end
|
53
55
|
end
|
54
56
|
|
@@ -57,7 +59,7 @@ describe Valvat::Utils do
|
|
57
59
|
expect(Valvat::Utils.vat_country_to_iso_country("EL")).to eql("GR")
|
58
60
|
end
|
59
61
|
|
60
|
-
Valvat::Utils::
|
62
|
+
Valvat::Utils::EU_MEMBER_STATES.each do |iso|
|
61
63
|
it "returns unchanged iso country code '#{iso}'" do
|
62
64
|
expect(Valvat::Utils.vat_country_to_iso_country(iso)).to eql(iso)
|
63
65
|
end
|
@@ -65,13 +67,31 @@ describe Valvat::Utils do
|
|
65
67
|
end
|
66
68
|
|
67
69
|
describe "#iso_country_to_vat_country" do
|
68
|
-
it "returns
|
70
|
+
it "returns VAT country on greek iso country code 'GR'" do
|
69
71
|
expect(Valvat::Utils.iso_country_to_vat_country("GR")).to eql("EL")
|
70
72
|
end
|
71
73
|
|
72
|
-
Valvat::Utils::
|
73
|
-
it "returns unchanged
|
74
|
+
Valvat::Utils::EU_MEMBER_STATES.each do |c|
|
75
|
+
it "returns unchanged VAT country code '#{c}'" do
|
74
76
|
expect(Valvat::Utils.iso_country_to_vat_country(c)).to eql(c)
|
77
|
+
end unless c == "GR"
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
describe "#country_is_supported?" do
|
82
|
+
Valvat::Utils::EU_MEMBER_STATES.each do |code|
|
83
|
+
it "returns true on #{code}" do
|
84
|
+
expect(Valvat::Utils.country_is_supported?(code)).to eql(true)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
it "returns true on GB" do
|
89
|
+
expect(Valvat::Utils.country_is_supported?("GB")).to eql(true)
|
90
|
+
end
|
91
|
+
|
92
|
+
["US", "AE", "CA", "CN", "BR", "AU", "NO", "ML"].each do |code|
|
93
|
+
it "returns false on #{code}" do
|
94
|
+
expect(Valvat::Utils.country_is_supported?(code)).to eql(false)
|
75
95
|
end
|
76
96
|
end
|
77
97
|
end
|
data/spec/valvat_spec.rb
CHANGED
@@ -44,7 +44,7 @@ describe Valvat do
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
context "on european
|
47
|
+
context "on european VAT number" do
|
48
48
|
let(:de_vat) { Valvat.new("DE259597697") } # valid & exists
|
49
49
|
let(:invalid_checksum) { Valvat.new("DE259597687") } # valid & invalid checksum
|
50
50
|
let(:at_vat) { Valvat.new("ATU458890031") } # invalid
|
@@ -74,9 +74,9 @@ describe Valvat do
|
|
74
74
|
end
|
75
75
|
|
76
76
|
describe "#exist(s)?" do
|
77
|
-
context "on existing
|
77
|
+
context "on existing VAT numbers" do
|
78
78
|
before do
|
79
|
-
allow(Valvat::Lookup).to receive_messages(:
|
79
|
+
allow(Valvat::Lookup).to receive_messages(validate: true)
|
80
80
|
end
|
81
81
|
|
82
82
|
it "returns true" do
|
@@ -87,9 +87,9 @@ describe Valvat do
|
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
|
-
context "on not existing
|
90
|
+
context "on not existing VAT numbers" do
|
91
91
|
before do
|
92
|
-
allow(Valvat::Lookup).to receive_messages(:
|
92
|
+
allow(Valvat::Lookup).to receive_messages(validate: false)
|
93
93
|
end
|
94
94
|
|
95
95
|
it "returns false" do
|
@@ -100,8 +100,8 @@ describe Valvat do
|
|
100
100
|
|
101
101
|
context "with options" do
|
102
102
|
it "calls Valvat::Lookup.validate with options" do
|
103
|
-
expect(Valvat::Lookup).to receive(:validate).once.with(de_vat, :
|
104
|
-
expect(de_vat.exists?(:
|
103
|
+
expect(Valvat::Lookup).to receive(:validate).once.with(de_vat, detail: true, bla: 'blupp').and_return(true)
|
104
|
+
expect(de_vat.exists?(detail: true, bla: 'blupp')).to eql(true)
|
105
105
|
end
|
106
106
|
end
|
107
107
|
end
|
@@ -112,7 +112,7 @@ describe Valvat do
|
|
112
112
|
expect(at_vat.iso_country_code).to eql("AT")
|
113
113
|
end
|
114
114
|
|
115
|
-
it "returns GR iso country code on greek
|
115
|
+
it "returns GR iso country code on greek VAT number" do
|
116
116
|
expect(gr_vat.iso_country_code).to eql("GR")
|
117
117
|
end
|
118
118
|
end
|
@@ -123,7 +123,7 @@ describe Valvat do
|
|
123
123
|
expect(at_vat.vat_country_code).to eql("AT")
|
124
124
|
end
|
125
125
|
|
126
|
-
it "returns EL iso language code on greek
|
126
|
+
it "returns EL iso language code on greek VAT number" do
|
127
127
|
expect(gr_vat.vat_country_code).to eql("EL")
|
128
128
|
end
|
129
129
|
end
|
@@ -137,7 +137,7 @@ describe Valvat do
|
|
137
137
|
end
|
138
138
|
|
139
139
|
describe "#to_s" do
|
140
|
-
it "returns full
|
140
|
+
it "returns full VAT number" do
|
141
141
|
expect(de_vat.to_s).to eql("DE259597697")
|
142
142
|
expect(at_vat.to_s).to eql("ATU458890031")
|
143
143
|
expect(gr_vat.to_s).to eql("EL999943280")
|
@@ -145,7 +145,7 @@ describe Valvat do
|
|
145
145
|
end
|
146
146
|
|
147
147
|
describe "#inspect" do
|
148
|
-
it "returns
|
148
|
+
it "returns VAT number with iso country code" do
|
149
149
|
expect(de_vat.inspect).to eql("#<Valvat DE259597697 DE>")
|
150
150
|
expect(at_vat.inspect).to eql("#<Valvat ATU458890031 AT>")
|
151
151
|
expect(gr_vat.inspect).to eql("#<Valvat EL999943280 GR>")
|
@@ -153,7 +153,7 @@ describe Valvat do
|
|
153
153
|
end
|
154
154
|
|
155
155
|
describe "#to_a" do
|
156
|
-
it "calls Valvat::Utils.split with raw
|
156
|
+
it "calls Valvat::Utils.split with raw VAT number and returns result" do
|
157
157
|
de_vat # initialize
|
158
158
|
expect(Valvat::Utils).to receive(:split).once.with("DE259597697").and_return(["a", "b"])
|
159
159
|
expect(de_vat.to_a).to eql(["a", "b"])
|
@@ -161,7 +161,7 @@ describe Valvat do
|
|
161
161
|
end
|
162
162
|
end
|
163
163
|
|
164
|
-
context "on
|
164
|
+
context "on VAT number from outside of europe" do
|
165
165
|
let(:us_vat) { Valvat.new("US345889003") }
|
166
166
|
let(:ch_vat) { Valvat.new("CH445889003") }
|
167
167
|
|
@@ -201,14 +201,14 @@ describe Valvat do
|
|
201
201
|
end
|
202
202
|
|
203
203
|
describe "#to_s" do
|
204
|
-
it "returns full given
|
204
|
+
it "returns full given VAT number" do
|
205
205
|
expect(us_vat.to_s).to eql("US345889003")
|
206
206
|
expect(ch_vat.to_s).to eql("CH445889003")
|
207
207
|
end
|
208
208
|
end
|
209
209
|
|
210
210
|
describe "#inspect" do
|
211
|
-
it "returns
|
211
|
+
it "returns VAT number without iso country code" do
|
212
212
|
expect(us_vat.inspect).to eql("#<Valvat US345889003>")
|
213
213
|
expect(ch_vat.inspect).to eql("#<Valvat CH445889003>")
|
214
214
|
end
|
@@ -216,7 +216,7 @@ describe Valvat do
|
|
216
216
|
|
217
217
|
end
|
218
218
|
|
219
|
-
context "on non-sense/empty
|
219
|
+
context "on non-sense/empty VAT number" do
|
220
220
|
let(:only_iso_vat) { Valvat.new("DE") }
|
221
221
|
let(:num_vat) { Valvat.new("12445889003") }
|
222
222
|
let(:empty_vat) { Valvat.new("") }
|
@@ -268,7 +268,7 @@ describe Valvat do
|
|
268
268
|
end
|
269
269
|
|
270
270
|
describe "#to_s" do
|
271
|
-
it "returns full given
|
271
|
+
it "returns full given VAT number" do
|
272
272
|
expect(only_iso_vat.to_s).to eql("DE")
|
273
273
|
expect(num_vat.to_s).to eql("12445889003")
|
274
274
|
expect(empty_vat.to_s).to eql("")
|
@@ -277,7 +277,7 @@ describe Valvat do
|
|
277
277
|
end
|
278
278
|
|
279
279
|
describe "#inspect" do
|
280
|
-
it "returns
|
280
|
+
it "returns VAT number without iso country code" do
|
281
281
|
expect(only_iso_vat.inspect).to eql("#<Valvat DE>")
|
282
282
|
expect(num_vat.inspect).to eql("#<Valvat 12445889003>")
|
283
283
|
expect(empty_vat.inspect).to eql("#<Valvat >")
|
data/valvat.gemspec
CHANGED
metadata
CHANGED
@@ -1,36 +1,40 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: valvat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Munz
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
+
|
31
|
-
|
13
|
+
MIIELDCCApSgAwIBAgIBATANBgkqhkiG9w0BAQsFADAgMR4wHAYDVQQDDBVzZWJh
|
14
|
+
c3RpYW4vREM9eW8vREM9bGswHhcNMjEwMTA2MTAzMDU3WhcNMjIwMTA2MTAzMDU3
|
15
|
+
WjAgMR4wHAYDVQQDDBVzZWJhc3RpYW4vREM9eW8vREM9bGswggGiMA0GCSqGSIb3
|
16
|
+
DQEBAQUAA4IBjwAwggGKAoIBgQC1KB7VOGa6pr926eaL2xCrnbnTxadpjq+6JoFj
|
17
|
+
6rvDpmgD8wkdfU7aFTwBiEK9JKzhqCoW86Rt/8wOrEJRMXz1QBbpMBSrubtMB+0/
|
18
|
+
N59hKPLwgBkhbxY7BwGnujxnTICgiGzkhjlgBe/MisoabfK5Tn84GWVk5e0/LUp1
|
19
|
+
qTRkSgcaDlnKs2/dAUo1lXHa13TJeemgz76TYx4p4J2w7VGh7WS2ax5SNWKw+J+q
|
20
|
+
HVSHT2Chc+a7As2cJyU/r2jX0oqSfvyg09CmF0inUBykeiuB9aeP/Me29hvg13/D
|
21
|
+
r1gaQ3/Vyfuqjs8lrwIZCWLU607g5q3+UM884WWpvApsZwzajNM2+9l5jay7Dnan
|
22
|
+
m05PcDtMYbPHiMyvuN9Vp4YIRqSBXP/DPGMnIYXbpzAQgtZymPQ8I3k8doj9q4+E
|
23
|
+
2Cf+x/nqvF09r/+gJj4ybzNW23zU6mhZ+xzBTDWrWBDetz+Y3wdbU5X6j08jLuEg
|
24
|
+
mMHmtgFdr/4VQxeaon7kHPR3DUsCAwEAAaNxMG8wCQYDVR0TBAIwADALBgNVHQ8E
|
25
|
+
BAMCBLAwHQYDVR0OBBYEFG8VE8+yijOldghb3w0MpSQnrslxMBoGA1UdEQQTMBGB
|
26
|
+
D3NlYmFzdGlhbkB5by5sazAaBgNVHRIEEzARgQ9zZWJhc3RpYW5AeW8ubGswDQYJ
|
27
|
+
KoZIhvcNAQELBQADggGBAIky67U9hnB8d4qMKwXHGb3Ne7JLvEigtEhjqGlDVecb
|
28
|
+
C94vQ8Jg7lYB3kKVjvFN2drptq/JUpxmAxPQIqfx39gKcKyv0BjkroVFE8MS1324
|
29
|
+
khMOZFOoSPMd9pkpm7oJ1M+sCYcUM+tPKnU8Ojq6r9j5b5XrbxG8YSpwahva3Vap
|
30
|
+
1g0+3KzuWPpFjFen1VbS/Sb1cyE5uQtUj7lVcdhF3EFvzXkUMUUtJ4xsk114znFO
|
31
|
+
986sKab5AjlJ7TnsmPphCv/UXans7rAVB2lnozlt/kw6dcct5JD4kz1tD6AmO5Qd
|
32
|
+
jWRuKNZs66GBglRvseKoypXz1XDCCu1m/uI1IGmKnq8Ry+IeRq9RnlvbfPvSxRIx
|
33
|
+
9aowoL79T9plhcEcEX/KYRp8ht1z+3Vyk2UVZP8Xl5x+K44co5xdhljYi1gtw0w8
|
34
|
+
KzzULF0bF9oNpXwBEamlH2myNb19u1W8ijobQ7Y19ca8UFHr5LI32ZW5Zlmep8je
|
35
|
+
vb+o07oLRx3t2T/EO4DZ1w==
|
32
36
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
37
|
+
date: 2021-01-06 00:00:00.000000000 Z
|
34
38
|
dependencies:
|
35
39
|
- !ruby/object:Gem::Dependency
|
36
40
|
name: savon
|
@@ -46,6 +50,20 @@ dependencies:
|
|
46
50
|
- - ">="
|
47
51
|
- !ruby/object:Gem::Version
|
48
52
|
version: 2.3.0
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: rake
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
type: :development
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
49
67
|
- !ruby/object:Gem::Dependency
|
50
68
|
name: rspec
|
51
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,6 +112,7 @@ files:
|
|
94
112
|
- gemfiles/activemodel-3-2
|
95
113
|
- gemfiles/activemodel-4
|
96
114
|
- gemfiles/activemodel-5
|
115
|
+
- gemfiles/activemodel-6
|
97
116
|
- gemfiles/before-ruby21/activemodel-3-2
|
98
117
|
- gemfiles/before-ruby21/activemodel-4
|
99
118
|
- gemfiles/before-ruby21/standalone
|
@@ -126,6 +145,7 @@ files:
|
|
126
145
|
- lib/valvat/checksum/ro.rb
|
127
146
|
- lib/valvat/checksum/se.rb
|
128
147
|
- lib/valvat/checksum/si.rb
|
148
|
+
- lib/valvat/error.rb
|
129
149
|
- lib/valvat/local.rb
|
130
150
|
- lib/valvat/locales/bg.yml
|
131
151
|
- lib/valvat/locales/ca.yml
|
@@ -148,8 +168,9 @@ files:
|
|
148
168
|
- lib/valvat/locales/sv.yml
|
149
169
|
- lib/valvat/locales/tr.yml
|
150
170
|
- lib/valvat/lookup.rb
|
171
|
+
- lib/valvat/lookup/fault.rb
|
151
172
|
- lib/valvat/lookup/request.rb
|
152
|
-
- lib/valvat/lookup/
|
173
|
+
- lib/valvat/lookup/response.rb
|
153
174
|
- lib/valvat/syntax.rb
|
154
175
|
- lib/valvat/utils.rb
|
155
176
|
- lib/valvat/version.rb
|
@@ -181,6 +202,9 @@ files:
|
|
181
202
|
- spec/valvat/checksum/se_spec.rb
|
182
203
|
- spec/valvat/checksum/si_spec.rb
|
183
204
|
- spec/valvat/checksum_spec.rb
|
205
|
+
- spec/valvat/lockup/fault_spec.rb
|
206
|
+
- spec/valvat/lockup/request_spec.rb
|
207
|
+
- spec/valvat/lockup/response_spec.rb
|
184
208
|
- spec/valvat/lookup_spec.rb
|
185
209
|
- spec/valvat/syntax_spec.rb
|
186
210
|
- spec/valvat/utils_spec.rb
|
@@ -190,7 +214,7 @@ homepage: https://github.com/yolk/valvat
|
|
190
214
|
licenses:
|
191
215
|
- MIT
|
192
216
|
metadata: {}
|
193
|
-
post_install_message:
|
217
|
+
post_install_message:
|
194
218
|
rdoc_options: []
|
195
219
|
require_paths:
|
196
220
|
- lib
|
@@ -206,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
230
|
version: '0'
|
207
231
|
requirements: []
|
208
232
|
rubygems_version: 3.0.3
|
209
|
-
signing_key:
|
233
|
+
signing_key:
|
210
234
|
specification_version: 4
|
211
235
|
summary: Validates european vat numbers. Standalone or as a ActiveModel validator.
|
212
236
|
test_files:
|
@@ -238,6 +262,9 @@ test_files:
|
|
238
262
|
- spec/valvat/checksum/se_spec.rb
|
239
263
|
- spec/valvat/checksum/si_spec.rb
|
240
264
|
- spec/valvat/checksum_spec.rb
|
265
|
+
- spec/valvat/lockup/fault_spec.rb
|
266
|
+
- spec/valvat/lockup/request_spec.rb
|
267
|
+
- spec/valvat/lockup/response_spec.rb
|
241
268
|
- spec/valvat/lookup_spec.rb
|
242
269
|
- spec/valvat/syntax_spec.rb
|
243
270
|
- spec/valvat/utils_spec.rb
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,31 +0,0 @@
|
|
1
|
-
class Valvat
|
2
|
-
class Lookup
|
3
|
-
class RequestWithId < Request
|
4
|
-
def initialize(vat, requester_vat)
|
5
|
-
@vat = vat
|
6
|
-
@requester_vat = requester_vat
|
7
|
-
end
|
8
|
-
|
9
|
-
private
|
10
|
-
|
11
|
-
def body
|
12
|
-
super.merge(
|
13
|
-
:requester_country_code => @requester_vat.vat_country_code,
|
14
|
-
:requester_vat_number => @requester_vat.to_s_wo_country
|
15
|
-
)
|
16
|
-
end
|
17
|
-
|
18
|
-
def message_tag
|
19
|
-
:checkVatApprox
|
20
|
-
end
|
21
|
-
|
22
|
-
def action
|
23
|
-
:check_vat_approx
|
24
|
-
end
|
25
|
-
|
26
|
-
def response_key
|
27
|
-
:check_vat_approx_response
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|