varejonline 0.4.0 → 0.5.0

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
- SHA1:
3
- metadata.gz: b039759125e05be0d9db12c636411860748cb456
4
- data.tar.gz: 550acd64c440105e3b5b52b74415e12105619172
2
+ SHA256:
3
+ metadata.gz: 0f93a86c047e87986f0f04d0503e2b50b3272ad048e01d05537b6182200941a6
4
+ data.tar.gz: 3e72e247dfe3b0ff253473794b2eceb99f1801ce46db7283d54cc32d811e296e
5
5
  SHA512:
6
- metadata.gz: 8887b6f7276cd91b0b61a4fb78c1b2e7050ba7bbb85f313050357200612a851b1a3965d9a6a86356ca52625bd3262cbcb9faa538ef6417b433ec873750d2f5ab
7
- data.tar.gz: 4e89dfe7b8191c12808a2b998e649a76def6e04465a4440f7872566530b1b463afb63eec66e19e0aa8335a428231464584e49c35995f21eb8b209020185b8d38
6
+ metadata.gz: 7a67886c15d3a19f335bcadd430eb1e1a0165be3836c6ab6826420326638bfdb36e7136337882a3f78ea7a078bfae1b36c27013abc9aba0f3daaf03380f72052
7
+ data.tar.gz: 789df1c841e4dfdcdf7606fb507ab3aab6d98d9174fd3b8fff16717b0649890b22bae732e33c9621628ecfbb98e50a8205036183eb0e73eeb55258ad7be3f626
data/README.md CHANGED
@@ -47,6 +47,8 @@ With the client instance, you can access the following resources:
47
47
  * Histórico de Vendas (client.sales_history) **Finding and more details**
48
48
  * Representantes (client.sellers) **Listing and finding**
49
49
  * Terceiros (client.third_parties) **Listing, finding, creation, credit limit information, credit limit updating, blocking/unblocking credit**
50
+ * Baixas (client.payments) **Only creation**
51
+ * Negociações de Cartão (client.card_negotiations) **Only listing**
50
52
  * Dados Login (client.user_data)
51
53
 
52
54
  ## Using the resources
@@ -69,6 +71,7 @@ Currently the following entities are implemented:
69
71
  * [Classes de Clientes](lib/varejonline/searcher/operational/client_class_searcher.rb)
70
72
  * [Pedidos de Venda](lib/varejonline/searcher/operational/order_searcher.rb)
71
73
  * [Representantes](lib/varejonline/searcher/operational/seller_searcher.rb)
74
+ * [Negociações de Cartão](lib/varejonline/searcher/financial/card_negotiation_searcher.rb)
72
75
 
73
76
  ### Finding
74
77
  Some resources implement a **find** method.
@@ -0,0 +1,13 @@
1
+ module Varejonline
2
+ module API
3
+ class CardNegotiations < Client
4
+ require_all 'varejonline/entity/financial', 'card_negotiation'
5
+
6
+ base_uri "#{Varejonline::API_ADDRESS}/negociacoes-cartao"
7
+
8
+ def list
9
+ return parse_response(self.class.get("/", body: build_body, headers: header))
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ module Varejonline
2
+ module API
3
+ class Payments < Client
4
+ base_uri "#{Varejonline::API_ADDRESS}/baixas"
5
+
6
+ def create(data)
7
+ return parse_response(self.class.post('/', body: build_body(data), headers: header))
8
+ end
9
+ alias :new :create
10
+ end
11
+ end
12
+ end
@@ -12,7 +12,7 @@ module Varejonline
12
12
 
13
13
  require_all 'varejonline/api', 'third_parties', 'entities', 'default_entries', 'provisions', 'user_data', 'installments', 'credit_limits',
14
14
  'client_classes', 'receivables', 'payables', 'sales_history', 'orders', 'companies', 'sellers', 'products', 'category_levels', 'product_categories',
15
- 'payment_conditions'
15
+ 'payment_conditions', 'payments', 'card_negotiations'
16
16
 
17
17
  attr_accessor :access_token
18
18
 
@@ -92,6 +92,14 @@ module Varejonline
92
92
  def payment_conditions
93
93
  Varejonline::API::PaymentConditions.new(@access_token)
94
94
  end
95
+
96
+ def payments
97
+ Varejonline::API::Payments.new(@access_token)
98
+ end
99
+
100
+ def card_negotiations
101
+ Varejonline::API::CardNegotiations.new(@access_token)
102
+ end
95
103
 
96
104
  protected
97
105
  def header
@@ -0,0 +1,11 @@
1
+ require 'varejonline/entity/base'
2
+
3
+ module Varejonline
4
+ module Entity
5
+ module Financial
6
+ class CardNegotiation < Base
7
+ attr_accessor :id, :ativo, :dataAlteracao, :descricao, :operadora, :bandeira, :tipoCartao
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'varejonline/searcher/base'
2
+
3
+ module Varejonline
4
+ module Searcher
5
+ module Financial
6
+ class CardNegotiationSearcher < Base
7
+ attr_accessor :inicio, :quantidade, :tipoCartao, :bandeiraCartao, :alteradoApos
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Varejonline
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: varejonline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Coyô
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-30 00:00:00.000000000 Z
11
+ date: 2017-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -55,6 +55,7 @@ files:
55
55
  - bin/console
56
56
  - bin/setup
57
57
  - lib/varejonline.rb
58
+ - lib/varejonline/api/card_negotiations.rb
58
59
  - lib/varejonline/api/category_levels.rb
59
60
  - lib/varejonline/api/client_classes.rb
60
61
  - lib/varejonline/api/companies.rb
@@ -65,6 +66,7 @@ files:
65
66
  - lib/varejonline/api/orders.rb
66
67
  - lib/varejonline/api/payables.rb
67
68
  - lib/varejonline/api/payment_conditions.rb
69
+ - lib/varejonline/api/payments.rb
68
70
  - lib/varejonline/api/product_categories.rb
69
71
  - lib/varejonline/api/products.rb
70
72
  - lib/varejonline/api/provisions.rb
@@ -83,6 +85,7 @@ files:
83
85
  - lib/varejonline/entity/commercial/item.rb
84
86
  - lib/varejonline/entity/commercial/order.rb
85
87
  - lib/varejonline/entity/commercial/product.rb
88
+ - lib/varejonline/entity/financial/card_negotiation.rb
86
89
  - lib/varejonline/entity/operational/category_level.rb
87
90
  - lib/varejonline/entity/operational/product_category.rb
88
91
  - lib/varejonline/init_from_hash.rb
@@ -92,6 +95,7 @@ files:
92
95
  - lib/varejonline/searcher/base.rb
93
96
  - lib/varejonline/searcher/commercial/credit_limit_searcher.rb
94
97
  - lib/varejonline/searcher/commercial/product_searcher.rb
98
+ - lib/varejonline/searcher/financial/card_negotiation_searcher.rb
95
99
  - lib/varejonline/searcher/financial/default_entry_searcher.rb
96
100
  - lib/varejonline/searcher/financial/payable_searcher.rb
97
101
  - lib/varejonline/searcher/financial/payment_condition_searcher.rb
@@ -121,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
125
  version: '0'
122
126
  requirements: []
123
127
  rubyforge_project:
124
- rubygems_version: 2.4.5
128
+ rubygems_version: 2.7.2
125
129
  signing_key:
126
130
  specification_version: 4
127
131
  summary: Integração com as APIs do Varejonline