vpsa 0.0.27 → 0.0.28

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c00eb2304cdaf283495f73c40703c30e0c93cc6
4
- data.tar.gz: e08c0450892cfa536b5c1c2249c27c624c3f1456
3
+ metadata.gz: 9a77dba462414c082c55ef8f6dc5b80965205df3
4
+ data.tar.gz: b7dea1bb6d0215d829c7eb0e8026682afb16418d
5
5
  SHA512:
6
- metadata.gz: d2a8809933938510841a417bce605642bda815f583ff91f85128985dabd6dc1be3594b71382517dfd20cb822d6c87458094184c4876b0905a88efbc62d0dd85e
7
- data.tar.gz: 5db6f70c434de3871b37a02fbfb3ef8ee49956b793535c41bb44530d372943b1645e867ec4531cf8ff6152b05764b69a48acabefbf6761ae7d4e6cf11d031df9
6
+ metadata.gz: f115522839e4dccbedcef557b12c1a0cd677183646b3b45e109ad43356029b4959f69f5bf1c0ed3bf919f5f5341755dd8e9ce09ef0edc17defac842fedcbcaa2
7
+ data.tar.gz: 9e6f4b01df059245da5913d4d7ed885048a1fb9fcbbeaf9887a0a289db543ec152f40cc4a5aa33482762b518e3e87c7053c405e92082e71035703d1219901572
@@ -0,0 +1,18 @@
1
+ module Vpsa
2
+ module Api
3
+ class PaymentConditions < Client
4
+ require_all 'vpsa/searcher/financial', 'payment_condition_searcher'
5
+
6
+ base_uri "#{Vpsa::API_ADDRESS}/planos-pagamento-compras"
7
+
8
+ def list(searcher = nil)
9
+ raise ArgumentError unless searcher.nil? || searcher.is_a?(Vpsa::Searcher::Financial::PaymentConditionSearcher)
10
+
11
+ return parse_response(self.class.get("/", :body => build_body(searcher.as_parameter), :headers => header)) if searcher
12
+ return parse_response(self.class.get("/", :body => build_body, :headers => header)) unless searcher
13
+ end
14
+
15
+
16
+ end
17
+ end
18
+ end
@@ -11,7 +11,8 @@ module Vpsa
11
11
  parser Proc.new {|b| JSON.parse(b) rescue b}
12
12
 
13
13
  require_all 'vpsa/api', 'third_parties', 'entities', 'default_entries', 'provisions', 'user_data', 'installments', 'credit_limits',
14
- 'client_classes', 'receipts', 'sales_history', 'orders', 'companies', 'sellers', 'products', 'category_levels', 'product_categories'
14
+ 'client_classes', 'receipts', 'sales_history', 'orders', 'companies', 'sellers', 'products', 'category_levels', 'product_categories',
15
+ 'payment_conditions'
15
16
 
16
17
  attr_accessor :access_token
17
18
 
@@ -83,6 +84,10 @@ module Vpsa
83
84
  def product_categories
84
85
  Vpsa::Api::ProductCategories.new(@access_token)
85
86
  end
87
+
88
+ def payment_conditions
89
+ Vpsa::Api::PaymentConditions.new(@access_token)
90
+ end
86
91
 
87
92
  protected
88
93
  def header
@@ -0,0 +1,11 @@
1
+ require 'vpsa/searcher/base'
2
+
3
+ module Vpsa
4
+ module Searcher
5
+ module Financial
6
+ class PaymentConditionSearcher < Base
7
+ attr_accessor :desde, :ate, :alteradoApos, :descricao
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Vpsa
2
- VERSION = "0.0.27"
2
+ VERSION = "0.0.28"
3
3
  end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Vpsa::Api::PaymentConditions do
4
+ let(:header) {{"Content-Type" => "application/json", "Accept" => "application/json"}}
5
+
6
+ describe "list" do
7
+ before(:each) do
8
+ stub_request(:get, "#{Vpsa::API_ADDRESS}/planos-pagamento-compras/").to_return(:status => 200)
9
+ end
10
+
11
+ it "should issue a get to the product categories url" do
12
+ expect(Vpsa::Api::PaymentConditions).to receive(:get).with("/", :body => {:token => "abc"}.to_json, :headers => header).and_call_original
13
+
14
+ Vpsa.new("abc").payment_conditions.list
15
+ end
16
+
17
+ end
18
+
19
+
20
+ end
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.27
4
+ version: 0.0.28
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-09-26 00:00:00.000000000 Z
11
+ date: 2015-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -61,6 +61,7 @@ files:
61
61
  - lib/vpsa/api/entities.rb
62
62
  - lib/vpsa/api/installments.rb
63
63
  - lib/vpsa/api/orders.rb
64
+ - lib/vpsa/api/payment_conditions.rb
64
65
  - lib/vpsa/api/product_categories.rb
65
66
  - lib/vpsa/api/products.rb
66
67
  - lib/vpsa/api/provisions.rb
@@ -86,6 +87,7 @@ files:
86
87
  - lib/vpsa/searcher/base.rb
87
88
  - lib/vpsa/searcher/commercial/credit_limit_searcher.rb
88
89
  - lib/vpsa/searcher/financial/default_entry_searcher.rb
90
+ - lib/vpsa/searcher/financial/payment_condition_searcher.rb
89
91
  - lib/vpsa/searcher/financial/receipt_searcher.rb
90
92
  - lib/vpsa/searcher/operational/client_class_searcher.rb
91
93
  - lib/vpsa/searcher/operational/order_searcher.rb
@@ -100,6 +102,7 @@ files:
100
102
  - spec/vpsa/api/entities_spec.rb
101
103
  - spec/vpsa/api/installments_spec.rb
102
104
  - spec/vpsa/api/orders_spec.rb
105
+ - spec/vpsa/api/payment_conditions_spec.rb
103
106
  - spec/vpsa/api/product_categories_spec.rb
104
107
  - spec/vpsa/api/products_spec.rb
105
108
  - spec/vpsa/api/provisions_spec.rb
@@ -153,6 +156,7 @@ test_files:
153
156
  - spec/vpsa/api/entities_spec.rb
154
157
  - spec/vpsa/api/installments_spec.rb
155
158
  - spec/vpsa/api/orders_spec.rb
159
+ - spec/vpsa/api/payment_conditions_spec.rb
156
160
  - spec/vpsa/api/product_categories_spec.rb
157
161
  - spec/vpsa/api/products_spec.rb
158
162
  - spec/vpsa/api/provisions_spec.rb