vpsa 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vpsa.rb +3 -0
- data/lib/vpsa/api/client_classes.rb +1 -1
- data/lib/vpsa/api/credit_limits.rb +1 -1
- data/lib/vpsa/api/default_entries.rb +1 -1
- data/lib/vpsa/api/entities.rb +1 -1
- data/lib/vpsa/api/installments.rb +3 -2
- data/lib/vpsa/api/provisions.rb +1 -1
- data/lib/vpsa/api/third_parties.rb +1 -1
- data/lib/vpsa/api/user_data.rb +1 -1
- data/lib/vpsa/client.rb +1 -0
- data/lib/vpsa/version.rb +1 -1
- data/spec/vpsa/api/client_classes_spec.rb +2 -2
- data/spec/vpsa/api/credit_limits_spec.rb +1 -1
- data/spec/vpsa/api/default_entries_spec.rb +2 -2
- data/spec/vpsa/api/entities_spec.rb +2 -2
- data/spec/vpsa/api/installments_spec.rb +3 -3
- data/spec/vpsa/api/provisions_spec.rb +1 -1
- data/spec/vpsa/api/third_parties_spec.rb +8 -8
- data/spec/vpsa/api/user_data_spec.rb +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: b7a0462fe237beea1b5d08e1cdc6a75b8fceffd5
|
4
|
+
data.tar.gz: 567dfc7a22eedeca18590c3d24c7ad47d757209b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8956cd9a7d663fec4ef106fceb6b86d2e4baff490ab42781a3f22e655273c6318177882e7edcbe4ebdecb36a7fd60bb2c600b0365f2359f9215a3c8bcaf58fb7
|
7
|
+
data.tar.gz: 7b15bbda9e1a49e06a930d32d587df030c13318757dd74c0ac93ff68fa519135067262dbdabfb44a71b4867a275d5bc7067982d59525d8153bace551d657944c
|
data/lib/vpsa.rb
CHANGED
@@ -3,7 +3,7 @@ module Vpsa
|
|
3
3
|
class ClientClasses < Client
|
4
4
|
require_all 'vpsa/searcher/operational', 'client_class_searcher'
|
5
5
|
|
6
|
-
base_uri "
|
6
|
+
base_uri "#{Vpsa::API_ADDRESS}/classificacoes-clientes"
|
7
7
|
|
8
8
|
def list(searcher = nil)
|
9
9
|
raise ArgumentError unless searcher.nil? || searcher.is_a?(Vpsa::Searcher::Operational::ClientClassSearcher)
|
@@ -3,7 +3,7 @@ module Vpsa
|
|
3
3
|
class CreditLimits < Client
|
4
4
|
require_all 'vpsa/searcher/commercial', 'credit_limit_searcher'
|
5
5
|
|
6
|
-
base_uri "
|
6
|
+
base_uri "#{Vpsa::API_ADDRESS}/limitescredito"
|
7
7
|
|
8
8
|
def list(searcher = nil)
|
9
9
|
raise ArgumentError unless searcher.nil? || searcher.is_a?(Vpsa::Searcher::Commercial::CreditLimitSearcher)
|
@@ -3,7 +3,7 @@ module Vpsa
|
|
3
3
|
class DefaultEntries < Client
|
4
4
|
require_all 'vpsa/searcher/financial', 'default_entry_searcher'
|
5
5
|
|
6
|
-
base_uri "
|
6
|
+
base_uri "#{Vpsa::API_ADDRESS}/lancamentos-padroes"
|
7
7
|
|
8
8
|
def list(searcher = nil)
|
9
9
|
raise ArgumentError unless searcher.nil? || searcher.is_a?(Vpsa::Searcher::Financial::DefaultEntrySearcher)
|
data/lib/vpsa/api/entities.rb
CHANGED
@@ -3,7 +3,7 @@ module Vpsa
|
|
3
3
|
class Entities < Client
|
4
4
|
require_all 'vpsa/searcher/administrative', 'entity_searcher'
|
5
5
|
|
6
|
-
base_uri "
|
6
|
+
base_uri "#{Vpsa::API_ADDRESS}/entidades"
|
7
7
|
|
8
8
|
def list(searcher = nil)
|
9
9
|
raise ArgumentError unless searcher.nil? || searcher.is_a?(Vpsa::Searcher::Administrative::EntitySearcher)
|
@@ -3,10 +3,11 @@ module Vpsa
|
|
3
3
|
class Installments < Client
|
4
4
|
require_all 'vpsa/entity/commercial', 'installment'
|
5
5
|
|
6
|
-
base_uri "
|
6
|
+
base_uri "#{Vpsa::API_ADDRESS}/configuracao-credito"
|
7
7
|
|
8
8
|
def configure(data)
|
9
|
-
return parse_response(self.class.
|
9
|
+
#return parse_response(self.class.put("/", :body => build_body(data), :headers => header))
|
10
|
+
return parse_response(self.class.put("/", :body => data.to_json, :headers => header))
|
10
11
|
end
|
11
12
|
|
12
13
|
def information
|
data/lib/vpsa/api/provisions.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Vpsa
|
2
2
|
module Api
|
3
3
|
class Provisions < Client
|
4
|
-
base_uri "
|
4
|
+
base_uri "#{Vpsa::API_ADDRESS}/provisoes-contas"
|
5
5
|
|
6
6
|
def create(data)
|
7
7
|
return parse_response(self.class.post("/", :body => build_body(data), :headers => header))
|
@@ -5,7 +5,7 @@ module Vpsa
|
|
5
5
|
require_all 'vpsa/entity/administrative', 'third_party', 'address', 'phone'
|
6
6
|
require_all 'vpsa/entity/commercial', 'credit_limit'
|
7
7
|
|
8
|
-
base_uri "
|
8
|
+
base_uri "#{Vpsa::API_ADDRESS}/terceiros"
|
9
9
|
|
10
10
|
def list(searcher = nil)
|
11
11
|
raise ArgumentError unless searcher.nil? || searcher.is_a?(Vpsa::Searcher::Administrative::ThirdPartySearcher)
|
data/lib/vpsa/api/user_data.rb
CHANGED
data/lib/vpsa/client.rb
CHANGED
data/lib/vpsa/version.rb
CHANGED
@@ -5,7 +5,7 @@ RSpec.describe Vpsa::Api::ClientClasses do
|
|
5
5
|
|
6
6
|
describe "listing" do
|
7
7
|
before(:each) do
|
8
|
-
stub_request(:get, "
|
8
|
+
stub_request(:get, "#{Vpsa::API_ADDRESS}/classificacoes-clientes/").to_return(:status => 200)
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should issue a get to the client classes url" do
|
@@ -29,7 +29,7 @@ RSpec.describe Vpsa::Api::ClientClasses do
|
|
29
29
|
|
30
30
|
describe "finding" do
|
31
31
|
before(:each) do
|
32
|
-
stub_request(:get, "
|
32
|
+
stub_request(:get, "#{Vpsa::API_ADDRESS}/classificacoes-clientes/5").to_return(:status => 200)
|
33
33
|
end
|
34
34
|
|
35
35
|
it "should issue a get to the client classes url" do
|
@@ -5,7 +5,7 @@ RSpec.describe Vpsa::Api::CreditLimits do
|
|
5
5
|
|
6
6
|
describe "listing" do
|
7
7
|
before(:each) do
|
8
|
-
stub_request(:get, "
|
8
|
+
stub_request(:get, "#{Vpsa::API_ADDRESS}/limitescredito/").to_return(:status => 200)
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should issue a get to the credit_limits url" do
|
@@ -5,7 +5,7 @@ RSpec.describe Vpsa::Api::DefaultEntries do
|
|
5
5
|
|
6
6
|
describe "listing" do
|
7
7
|
before(:each) do
|
8
|
-
stub_request(:get, "
|
8
|
+
stub_request(:get, "#{Vpsa::API_ADDRESS}/lancamentos-padroes/").to_return(:status => 200)
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should issue a get to the default_entries url" do
|
@@ -29,7 +29,7 @@ RSpec.describe Vpsa::Api::DefaultEntries do
|
|
29
29
|
|
30
30
|
describe "finding" do
|
31
31
|
before(:each) do
|
32
|
-
stub_request(:get, "
|
32
|
+
stub_request(:get, "#{Vpsa::API_ADDRESS}/lancamentos-padroes/5").to_return(:status => 200)
|
33
33
|
end
|
34
34
|
|
35
35
|
it "should issue a get to the default entry url" do
|
@@ -5,7 +5,7 @@ RSpec.describe Vpsa::Api::Entities do
|
|
5
5
|
|
6
6
|
describe "listing" do
|
7
7
|
before(:each) do
|
8
|
-
stub_request(:get, "
|
8
|
+
stub_request(:get, "#{Vpsa::API_ADDRESS}/entidades/").to_return(:status => 200)
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should issue a get to the entities url" do
|
@@ -29,7 +29,7 @@ RSpec.describe Vpsa::Api::Entities do
|
|
29
29
|
|
30
30
|
describe "finding" do
|
31
31
|
before(:each) do
|
32
|
-
stub_request(:get, "
|
32
|
+
stub_request(:get, "#{Vpsa::API_ADDRESS}/entidades/5").to_return(:status => 200)
|
33
33
|
end
|
34
34
|
|
35
35
|
it "should issue a get to the entity url" do
|
@@ -5,7 +5,7 @@ RSpec.describe Vpsa::Api::Installments do
|
|
5
5
|
|
6
6
|
describe "information" do
|
7
7
|
before(:each) do
|
8
|
-
stub_request(:get, "
|
8
|
+
stub_request(:get, "#{Vpsa::API_ADDRESS}/configuracao-credito/").to_return(:status => 200)
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should issue a get to the installments url" do
|
@@ -17,13 +17,13 @@ RSpec.describe Vpsa::Api::Installments do
|
|
17
17
|
|
18
18
|
describe "configuration" do
|
19
19
|
before(:each) do
|
20
|
-
stub_request(:
|
20
|
+
stub_request(:put, "#{Vpsa::API_ADDRESS}/configuracao-credito/").to_return(:status => 201)
|
21
21
|
end
|
22
22
|
|
23
23
|
let(:installment_param) {{}}
|
24
24
|
|
25
25
|
it "should issue a post to the installments url" do
|
26
|
-
expect(Vpsa::Api::Installments).to receive(:
|
26
|
+
expect(Vpsa::Api::Installments).to receive(:put).with("/", :body => installment_param.merge!({:token => "abc"}).to_json, :headers => header).and_call_original
|
27
27
|
|
28
28
|
Vpsa.new("abc").installments.configure(installment_param)
|
29
29
|
end
|
@@ -5,7 +5,7 @@ RSpec.describe Vpsa::Api::Provisions do
|
|
5
5
|
|
6
6
|
describe "creation" do
|
7
7
|
before(:each) do
|
8
|
-
stub_request(:post, "
|
8
|
+
stub_request(:post, "#{Vpsa::API_ADDRESS}/provisoes-contas/").to_return(:status => 201)
|
9
9
|
end
|
10
10
|
|
11
11
|
let(:provision_param) {{:"idLancamentoPadrao" => 3, :"idEntidade" => 1, :"idTerceiro" => 2, :data => "25-02-2019", :valor => "123.50", :historico => "histórico"}}
|
@@ -5,7 +5,7 @@ RSpec.describe Vpsa::Api::ThirdParties do
|
|
5
5
|
|
6
6
|
describe "listing" do
|
7
7
|
before(:each) do
|
8
|
-
stub_request(:get, "
|
8
|
+
stub_request(:get, "#{Vpsa::API_ADDRESS}/terceiros/").to_return(:status => 200)
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should issue a get to the third_parties url" do
|
@@ -29,7 +29,7 @@ RSpec.describe Vpsa::Api::ThirdParties do
|
|
29
29
|
|
30
30
|
describe "finding" do
|
31
31
|
before(:each) do
|
32
|
-
stub_request(:get, "
|
32
|
+
stub_request(:get, "#{Vpsa::API_ADDRESS}/terceiros/5").to_return(:status => 200)
|
33
33
|
end
|
34
34
|
|
35
35
|
it "should issue a get to the third party url" do
|
@@ -58,7 +58,7 @@ RSpec.describe Vpsa::Api::ThirdParties do
|
|
58
58
|
|
59
59
|
@third_party.classes = ["SOCIO_PROPRIETARIO", "FUNCIONARIO"]
|
60
60
|
|
61
|
-
stub_request(:post, "
|
61
|
+
stub_request(:post, "#{Vpsa::API_ADDRESS}/terceiros/").to_return(:status => 201)
|
62
62
|
end
|
63
63
|
|
64
64
|
describe "with raw parameters" do
|
@@ -87,7 +87,7 @@ RSpec.describe Vpsa::Api::ThirdParties do
|
|
87
87
|
describe "credit limit" do
|
88
88
|
context "information" do
|
89
89
|
before(:each) do
|
90
|
-
stub_request(:get, "
|
90
|
+
stub_request(:get, "#{Vpsa::API_ADDRESS}/terceiros/5/limites_credito").to_return(:status => 200)
|
91
91
|
end
|
92
92
|
|
93
93
|
it "should issue a get to the third party credit limit url" do
|
@@ -103,7 +103,7 @@ RSpec.describe Vpsa::Api::ThirdParties do
|
|
103
103
|
before(:each) do
|
104
104
|
@credit_limit = Vpsa::Entity::Commercial::CreditLimit.new({"total" => BigDecimal.new("154.32")})
|
105
105
|
|
106
|
-
stub_request(:put, "
|
106
|
+
stub_request(:put, "#{Vpsa::API_ADDRESS}/terceiros/5/limites_credito").to_return(:status => 200)
|
107
107
|
end
|
108
108
|
|
109
109
|
describe "with raw parameters" do
|
@@ -133,7 +133,7 @@ RSpec.describe Vpsa::Api::ThirdParties do
|
|
133
133
|
let(:credit_limit_block_params) {{"justificativa" => "Cliente caloteiro", :token => "abc"}}
|
134
134
|
|
135
135
|
before(:each) do
|
136
|
-
stub_request(:put, "
|
136
|
+
stub_request(:put, "#{Vpsa::API_ADDRESS}/terceiros/5/limites_credito/bloquear").to_return(:status => 200)
|
137
137
|
end
|
138
138
|
|
139
139
|
it "should put to the third party credit block url" do
|
@@ -147,7 +147,7 @@ RSpec.describe Vpsa::Api::ThirdParties do
|
|
147
147
|
let(:credit_limit_unlock_params) {{"justificativa" => "Cliente pagou", :token => "abc"}}
|
148
148
|
|
149
149
|
before(:each) do
|
150
|
-
stub_request(:put, "
|
150
|
+
stub_request(:put, "#{Vpsa::API_ADDRESS}/terceiros/5/limites_credito/desbloquear").to_return(:status => 200)
|
151
151
|
end
|
152
152
|
|
153
153
|
it "should put to the third party credit unlock url" do
|
@@ -161,7 +161,7 @@ RSpec.describe Vpsa::Api::ThirdParties do
|
|
161
161
|
let(:history_params) {{"desde" => Date.parse("01/01/2015"), "ate" => Date.parse("11/01/2015"), :token => "abc"}}
|
162
162
|
|
163
163
|
before(:each) do
|
164
|
-
stub_request(:get, "
|
164
|
+
stub_request(:get, "#{Vpsa::API_ADDRESS}/terceiros/5/limites_credito/historico").to_return(:status => 200)
|
165
165
|
end
|
166
166
|
|
167
167
|
it "should issue a get to the third party credit history url" do
|
@@ -5,7 +5,7 @@ RSpec.describe Vpsa::Api::UserData do
|
|
5
5
|
|
6
6
|
describe "finding" do
|
7
7
|
before(:each) do
|
8
|
-
stub_request(:get, "
|
8
|
+
stub_request(:get, "#{Vpsa::API_ADDRESS}/dados-login/").to_return(:status => 200)
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should issue a get to the dados-login url" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vpsa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gustavo Berdugo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
115
|
rubyforge_project:
|
116
|
-
rubygems_version: 2.4.
|
116
|
+
rubygems_version: 2.4.6
|
117
117
|
signing_key:
|
118
118
|
specification_version: 4
|
119
119
|
summary: This gem provides integration with VPSA APIs (http://www.vpsa.com.br/)
|