rs.ge 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rs/requests/dict.rb +11 -1
- data/lib/rs/version.rb +1 -1
- data/spec/requests/dict_spec.rb +5 -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: ac581151418ca530b173ecff8ee7c3af51e01403
|
4
|
+
data.tar.gz: 431258966af3e3eaf31c165760ce3245101b9cfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b1890c28796f8e39db0d5a5fec819451b76b141563c6a256daece716b5a8bb0740e2518d784210879bb763d6dfeaca386d992e593628741ce5e18bada8786ba
|
7
|
+
data.tar.gz: dcc929d4b17105573d407a62c29d4afcea3c2e03bc0c33c211af4cafd63a71be3920d2611e35b749246e6823318c28c978a3867336513f9947680b829b1c1400
|
data/lib/rs/requests/dict.rb
CHANGED
@@ -99,7 +99,17 @@ module RS
|
|
99
99
|
end.to_hash
|
100
100
|
p_id = response[:get_un_id_from_tin_response][:get_un_id_from_tin_result].to_i
|
101
101
|
name = response[:get_un_id_from_tin_response][:name]
|
102
|
-
{payer_id: p_id, name: name}
|
102
|
+
{ payer_id: p_id, name: name }
|
103
|
+
end
|
104
|
+
|
105
|
+
# Is given organization a vat payer?
|
106
|
+
def is_vat_payer(params = {})
|
107
|
+
validate_presence_of(params, :su, :sp, :tin)
|
108
|
+
payer_id = get_payer_info(su: params[:su], sp: params[:sp], tin: params[:tin])[:payer_id]
|
109
|
+
response = waybill_client.request 'is_vat_payer' do
|
110
|
+
soap.body = { 'su' => params[:su], 'sp' => params[:sp], 'un_id' => payer_id }
|
111
|
+
end.to_hash
|
112
|
+
response[:is_vat_payer_response][:is_vat_payer_result]
|
103
113
|
end
|
104
114
|
|
105
115
|
# Returns name by given TIN number.
|
data/lib/rs/version.rb
CHANGED
data/spec/requests/dict_spec.rb
CHANGED
@@ -54,6 +54,11 @@ describe 'payer_user_id testing' do
|
|
54
54
|
it { should == RS.config.user_id }
|
55
55
|
end
|
56
56
|
|
57
|
+
describe 'is_vat_payer?' do
|
58
|
+
specify { RS.dict.is_vat_payer(tin: '422430239').should == false }
|
59
|
+
specify { RS.dict.is_vat_payer(tin: '204417363').should == true }
|
60
|
+
end
|
61
|
+
|
57
62
|
describe 'getting payer information by its TIN number' do
|
58
63
|
before(:all) do
|
59
64
|
@info = RS.dict.get_payer_info(tin: '422430239')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rs.ge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitri Kurashvili
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|