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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f436303c19a11e82f62c331c717c7759b905927c
4
- data.tar.gz: 92608dd0cbe1ebf0f4b4c93f0e8f1c3feb63c9fc
3
+ metadata.gz: ac581151418ca530b173ecff8ee7c3af51e01403
4
+ data.tar.gz: 431258966af3e3eaf31c165760ce3245101b9cfb
5
5
  SHA512:
6
- metadata.gz: 9d326ac879d6090a7bde80f94ec871057fb2fb717a3a95a1bd2d1e9e5dc672f40ab17d6a3e2ddeae1c0cff21ebc071df0bd3705187f42521b99f0071ab380c71
7
- data.tar.gz: 3c7d9d1715b893fee2df7c1e58a22b198b28f50ae835bec3fa998556471cc14da937ff7788383b5c56ea52e5f1c15322b07ed8a30c3936d764e5d3a6b61b567a
6
+ metadata.gz: 1b1890c28796f8e39db0d5a5fec819451b76b141563c6a256daece716b5a8bb0740e2518d784210879bb763d6dfeaca386d992e593628741ce5e18bada8786ba
7
+ data.tar.gz: dcc929d4b17105573d407a62c29d4afcea3c2e03bc0c33c211af4cafd63a71be3920d2611e35b749246e6823318c28c978a3867336513f9947680b829b1c1400
@@ -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.
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module RS
3
- VERSION = '0.1.9'
3
+ VERSION = '0.1.10'
4
4
  end
@@ -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.9
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-10-30 00:00:00.000000000 Z
11
+ date: 2013-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec