varejonline 0.1.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 +7 -0
- data/.gitignore +15 -0
- data/.rspec +2 -0
- data/.travis.yml +23 -0
- data/Gemfile +16 -0
- data/README.md +109 -0
- data/Rakefile +8 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/varejonline.rb +38 -0
- data/lib/varejonline/api/category_levels.rb +13 -0
- data/lib/varejonline/api/client_classes.rb +20 -0
- data/lib/varejonline/api/companies.rb +20 -0
- data/lib/varejonline/api/credit_limits.rb +20 -0
- data/lib/varejonline/api/default_entries.rb +20 -0
- data/lib/varejonline/api/entities.rb +20 -0
- data/lib/varejonline/api/installments.rb +17 -0
- data/lib/varejonline/api/orders.rb +26 -0
- data/lib/varejonline/api/payment_conditions.rb +16 -0
- data/lib/varejonline/api/product_categories.rb +13 -0
- data/lib/varejonline/api/products.rb +17 -0
- data/lib/varejonline/api/provisions.rb +12 -0
- data/lib/varejonline/api/receipts.rb +20 -0
- data/lib/varejonline/api/sales_history.rb +15 -0
- data/lib/varejonline/api/sellers.rb +20 -0
- data/lib/varejonline/api/third_parties.rb +56 -0
- data/lib/varejonline/api/user_data.rb +11 -0
- data/lib/varejonline/client.rb +121 -0
- data/lib/varejonline/entity/administrative/address.rb +11 -0
- data/lib/varejonline/entity/administrative/phone.rb +11 -0
- data/lib/varejonline/entity/administrative/third_party.rb +33 -0
- data/lib/varejonline/entity/base.rb +19 -0
- data/lib/varejonline/entity/commercial/credit_limit.rb +11 -0
- data/lib/varejonline/entity/commercial/installment.rb +15 -0
- data/lib/varejonline/entity/commercial/item.rb +11 -0
- data/lib/varejonline/entity/commercial/order.rb +12 -0
- data/lib/varejonline/entity/commercial/product.rb +13 -0
- data/lib/varejonline/entity/operational/category_level.rb +11 -0
- data/lib/varejonline/entity/operational/product_category.rb +11 -0
- data/lib/varejonline/init_from_hash.rb +9 -0
- data/lib/varejonline/searcher/administrative/company_searcher.rb +10 -0
- data/lib/varejonline/searcher/administrative/entity_searcher.rb +11 -0
- data/lib/varejonline/searcher/administrative/third_party_searcher.rb +11 -0
- data/lib/varejonline/searcher/base.rb +21 -0
- data/lib/varejonline/searcher/commercial/credit_limit_searcher.rb +11 -0
- data/lib/varejonline/searcher/financial/default_entry_searcher.rb +11 -0
- data/lib/varejonline/searcher/financial/payment_condition_searcher.rb +11 -0
- data/lib/varejonline/searcher/financial/receipt_searcher.rb +11 -0
- data/lib/varejonline/searcher/operational/client_class_searcher.rb +10 -0
- data/lib/varejonline/searcher/operational/order_searcher.rb +11 -0
- data/lib/varejonline/searcher/operational/seller_searcher.rb +11 -0
- data/lib/varejonline/version.rb +3 -0
- data/varejonline.gemspec +32 -0
- metadata +125 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 8313d9c11791f2d9a3e84f368e7eedda2468c39c
|
|
4
|
+
data.tar.gz: 582155ec0e8273c0b1da87f081d551b8071a6c03
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: ea3a6e68dce63aef69f007778cebd87b956897e17c777329c4ca429f091caf5b66946d40719f60364e00927978b6a5f8fa99764f381d8225bc5a1daf091cf38d
|
|
7
|
+
data.tar.gz: 751222955f9d0086c95729e3eff9ff3174388a5e8cfff96c64e8a750fe816a1f549d4a709608f1a9e4544d0ef02eb319b57480e6778d9ce4fb05e448335cba7e
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
language: ruby
|
|
2
|
+
rvm:
|
|
3
|
+
- 2.0.0
|
|
4
|
+
addons:
|
|
5
|
+
code_climate:
|
|
6
|
+
repo_token:
|
|
7
|
+
secure: bKJQ6L6aLMAylklIfsrEdjrhWVd42wHrZ9oyydzjV8yLBKPAfkdT93mN1WKGgGWVExhAXvryk8iaifahiplg7qznqzdeB/c1mdVbUmgR1CwiSMP0m/q2CN6MonZJ9gMymraYR1LC+8mTMoppgewEGPqFynxDKNhPzzrTAHXnPLX9vunkmqqp63QILwS3C8q6Ed8izLLbgHI3Wpj7KSEBHSja8y3FmaEj/UYKz8i5ESvRyyoHCOtM5lSY3D5mR1i0OKVOqjUwN635Op7cB31zZxIsebmHO+VwOlTBb3W2qxYOVlThrUfgyw2T9rgOy8L93CTPg4FIdWMglbLI/6Q2Q/4B/1gk2gXU6bZ0M49bVgVtqnXqZnnxyK6e7iiJ+VhN+bXhH8tRQmSnzofiqXI2PDYoUhG+IFrh+H8Ig655Ho48QhXRYYnghWTNs5xi7WrpTIBP3PS27taP2zdHYxLDg1qRk/a2qbBl+oO0nd5Ms4Xf2ioZWdVgOU3s9GefMLEWvp8sBcfRzC25Rdki1hlL7dpNf4/piG6tptZdYmXix5uSA8Y3IyPuqutzSoM3LSfKPiSnL3wuxjD9knq2LpYHep7VoLxE5Q3vTgiBuDngi25LT49weyhjjF5omfkpx2RUC/YKs2HjMqrx3OkTXpmZUXc8TO4IcRXjLvsqt0IX8Os=
|
|
8
|
+
after_success:
|
|
9
|
+
- bundle exec codeclimate-test-reporter
|
|
10
|
+
bundler_args: "--without development"
|
|
11
|
+
notifications:
|
|
12
|
+
email:
|
|
13
|
+
recipients:
|
|
14
|
+
- ti@coyo.com.br
|
|
15
|
+
on_failure: change
|
|
16
|
+
on_success: never
|
|
17
|
+
deploy:
|
|
18
|
+
provider: rubygems
|
|
19
|
+
api_key:
|
|
20
|
+
secure: KPJfKFZVnZQ6mVzvOAfDbnG36AYSMOh7Ac7e2UJwBDTmZuONbkpRtlOaA+6OajDrMT0dsuLAM0eoC3j4OTYdC5A6Y0J5ZbjqiiNQg/RLRry56pNjj7S75ylUDusZjRK102ZscWnfFJJqSA/lcFrhR4i7EPZ/dd6YCe1/CXQmDzxz2Bdqnay0wDBUZmz3h+Om59ChFytf0rH7cK9sK4eojRXYO3jXkMCDqS4A0SSmQ9+RP4NuheL0DLmQ2Ctrur+hv+/icT6u9DNUu/5B/loEO65jJ7UMHa/Z5oFRrHG7PJG9+HiEp5LrQX4upqtXe2DBzit6nPN6qegbFxtF5VmsbOjfswAu+Q2jCL9VV7NiROxoyPoyWzXTF856gMs55w3FIuLysSgqff5v24RbfJr0CNj2lrdhO3lWkw8S2lI50jsOlJ91c668KdntodypDSPDPRn8XxRny8QUHLeruWc3WVV7zKafb31ZB5Jxxh4nmC7woxeV1hzG6enPz1WPOhS/DTMdzufwPl+Vy7Y6gtboJTYfKICMzSrdzZ0Por19RBaAOlw9+UyqdK4XDTxkwddeL+11qWOdzG1zyCMZhtVN8AX7XGSgya5wb7jsFmNOy6lkTNCgymQEl5xGPXLEC/18GTNEW2OnRXPaZ3fHa+dadIs1Y40uT+0LVqQb2tWQ6LY=
|
|
21
|
+
gem: varejonline
|
|
22
|
+
on:
|
|
23
|
+
repo: coyosoftware/varejonline
|
data/Gemfile
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
# Specify your gem's dependencies in varejonline.gemspec
|
|
4
|
+
gemspec
|
|
5
|
+
|
|
6
|
+
group :development, :test do
|
|
7
|
+
gem 'byebug'
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
group :test do
|
|
11
|
+
gem "rake"
|
|
12
|
+
gem 'rspec', '~> 3.5'
|
|
13
|
+
gem 'webmock', '~> 2.0'
|
|
14
|
+
gem 'simplecov'
|
|
15
|
+
gem 'codeclimate-test-reporter', '~> 1.0.0'
|
|
16
|
+
end
|
data/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Varejonline
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.org/coyosoftware/varejonline) [](http://badge.fury.io/rb/varejonline) [](https://codeclimate.com/github/coyosoftware/varejonline/coverage) [](https://codeclimate.com/github/coyosoftware/varejonline)
|
|
4
|
+
|
|
5
|
+
This gem simplifies the usage of [Varejonline](http://varejonline.com.br/) API
|
|
6
|
+
|
|
7
|
+
For more information regarding the API, visit the [documentation]
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Add this line to your application's Gemfile:
|
|
12
|
+
|
|
13
|
+
gem 'varejonline'
|
|
14
|
+
|
|
15
|
+
And then execute:
|
|
16
|
+
|
|
17
|
+
$ bundle
|
|
18
|
+
|
|
19
|
+
Or install it yourself as:
|
|
20
|
+
|
|
21
|
+
$ gem install varejonline
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
Create a new instance of Varejonline class passing your access token:
|
|
26
|
+
|
|
27
|
+
```ruby
|
|
28
|
+
client = Varejonline.new(YOUR_ACCESS_TOKEN)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
With the client instance, you can access the following resources:
|
|
32
|
+
|
|
33
|
+
* Classes de Clientes (client.client_classes) **Listing and finding**
|
|
34
|
+
* Configuração de crédito (client.installments) **Saving and information**
|
|
35
|
+
* Contas a Receber (client.receipts) **Listing and finding**
|
|
36
|
+
* Dados Login (client.user_data)
|
|
37
|
+
* Empresas (client.companies) **Listing and finding**
|
|
38
|
+
* Entidades (client.entities) **Listing and finding**
|
|
39
|
+
* Histórico de Vendas (client.sales_history) **Finding and more details **
|
|
40
|
+
* Lançamentos Padrões (client.default_entries) **Listing and finding**
|
|
41
|
+
* Limite de Créditos (client.credit_limits) **Listing and block history**
|
|
42
|
+
* Pedidos de venda (client.orders) **Listing and finding**
|
|
43
|
+
* Provisões (client.provisions) **Only Creation**
|
|
44
|
+
* Representantes (client.sellers) **Listing and finding**
|
|
45
|
+
* Terceiros (client.third_parties) **Listing, finding, creation, credit limit information, credit limit updating, blocking/unblocking credit**
|
|
46
|
+
|
|
47
|
+
## Using the resources
|
|
48
|
+
### Listing
|
|
49
|
+
All resources implement a **list** method.
|
|
50
|
+
|
|
51
|
+
It can accept an Entity object that reflects the searchable API fields.
|
|
52
|
+
|
|
53
|
+
Currently the following entities are implemented:
|
|
54
|
+
|
|
55
|
+
* [Classes de Clientes](lib/varejonline/searcher/operational/client_class_searcher.rb)
|
|
56
|
+
* [Contas a Receber](lib/varejonline/searcher/financial/receipt_searcher.rb)
|
|
57
|
+
* [Empresas](lib/varejonline/searcher/administrative/company_searcher.rb)
|
|
58
|
+
* [Entidades](lib/varejonline/searcher/administrative/entity_searcher.rb)
|
|
59
|
+
* [Lançamentos Padrões](lib/varejonline/searcher/financial/default_entry_searcher.rb)
|
|
60
|
+
* [Limite de Crédito](lib/varejonline/searcher/commercial/credit_limit_searcher.rb)
|
|
61
|
+
* [Pedidos de Venda](lib/varejonline/searcher/operational/order_searcher.rb)
|
|
62
|
+
* [Representantes](lib/varejonline/searcher/operational/seller_searcher.rb)
|
|
63
|
+
* [Terceiros](lib/varejonline/searcher/administrative/third_party_searcher.rb)
|
|
64
|
+
|
|
65
|
+
### Finding
|
|
66
|
+
All resources implement a **find** method.
|
|
67
|
+
|
|
68
|
+
It finds the resource with the passed ID.
|
|
69
|
+
|
|
70
|
+
```ruby
|
|
71
|
+
Varejonline.new(YOUR_ACCESS_TOKEN).third_parties.find(4)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Creation
|
|
75
|
+
Some resources implement a **create** method.
|
|
76
|
+
|
|
77
|
+
It creates a new resource base on the information passed via Hash.
|
|
78
|
+
|
|
79
|
+
```ruby
|
|
80
|
+
Varejonline.new(YOUR_ACCESS_TOKEN).provisions.create({:"idLancamentoPadrao" => 3, :"idEntidade" => 1, :"idTerceiro" => 15, :"data" => "21-10-2012", :"valor" =>123.40, :"historico" => "histórico da provisão"})
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Getting User Data
|
|
84
|
+
You can get the token owner information by calling the following method:
|
|
85
|
+
|
|
86
|
+
```ruby
|
|
87
|
+
Varejonline.new(YOUR_ACCESS_TOKEN).user_data.get
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Reading the response
|
|
91
|
+
All methods return a Varejonline::Client::Response object. This object contains the following attributes:
|
|
92
|
+
|
|
93
|
+
```ruby
|
|
94
|
+
response = Varejonline.new(YOUR_ACCESS_TOKEN).third_parties.list
|
|
95
|
+
|
|
96
|
+
response.status # Contains the status code of the request
|
|
97
|
+
response.payload # Contains the return data (JSON) of the request
|
|
98
|
+
response.raw_response # Contains the HTTParty response object
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Contributing
|
|
102
|
+
|
|
103
|
+
1. Fork it ( https://github.com/coyosoftware/varejonline/fork )
|
|
104
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
105
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
106
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
107
|
+
5. Create a new Pull Request
|
|
108
|
+
|
|
109
|
+
[documentation]: https://github.com/Varejonline/api/wiki
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "varejonline"
|
|
5
|
+
|
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
+
|
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
+
# require "pry"
|
|
11
|
+
# Pry.start
|
|
12
|
+
|
|
13
|
+
require "irb"
|
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/lib/varejonline.rb
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
require "varejonline/version"
|
|
2
|
+
|
|
3
|
+
module Varejonline
|
|
4
|
+
LIBNAME = 'varejonline'
|
|
5
|
+
LIBDIR = File.expand_path("../#{LIBNAME}", __FILE__)
|
|
6
|
+
|
|
7
|
+
API_ADDRESS = "https://erp.varejonline.com.br/apps/api"
|
|
8
|
+
|
|
9
|
+
class << self
|
|
10
|
+
def included(base)
|
|
11
|
+
base.extend ClassMethods
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def new(access_token)
|
|
15
|
+
Client.new(access_token)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
module ClassMethods
|
|
20
|
+
# Requires internal libraries
|
|
21
|
+
#
|
|
22
|
+
# @param [String] prefix
|
|
23
|
+
# the relative path prefix
|
|
24
|
+
# @param [Array[String]] libs
|
|
25
|
+
# the array of libraries to require
|
|
26
|
+
#
|
|
27
|
+
# @return [self]
|
|
28
|
+
def require_all(prefix, *libs)
|
|
29
|
+
libs.each do |lib|
|
|
30
|
+
require "#{File.join(prefix, lib)}"
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
extend ClassMethods
|
|
36
|
+
|
|
37
|
+
require_all LIBDIR, 'client'
|
|
38
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module Varejonline
|
|
2
|
+
module API
|
|
3
|
+
class CategoryLevels < Client
|
|
4
|
+
require_all 'varejonline/entity/operational', 'category_level'
|
|
5
|
+
|
|
6
|
+
base_uri "#{Varejonline::API_ADDRESS}/niveis-categoria-produto"
|
|
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,20 @@
|
|
|
1
|
+
module Varejonline
|
|
2
|
+
module API
|
|
3
|
+
class ClientClasses < Client
|
|
4
|
+
require_all 'varejonline/searcher/operational', 'client_class_searcher'
|
|
5
|
+
|
|
6
|
+
base_uri "#{Varejonline::API_ADDRESS}/classificacoes-clientes"
|
|
7
|
+
|
|
8
|
+
def list(searcher = nil)
|
|
9
|
+
raise ArgumentError unless searcher.nil? || searcher.is_a?(Varejonline::Searcher::Operational::ClientClassSearcher)
|
|
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
|
+
def find(id)
|
|
16
|
+
return parse_response(self.class.get("/#{id}", body: build_body, headers: header))
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Varejonline
|
|
2
|
+
module API
|
|
3
|
+
class Companies < Client
|
|
4
|
+
require_all 'varejonline/searcher/administrative', 'company_searcher'
|
|
5
|
+
|
|
6
|
+
base_uri "#{Varejonline::API_ADDRESS}/empresas"
|
|
7
|
+
|
|
8
|
+
def list(searcher = nil)
|
|
9
|
+
raise ArgumentError unless searcher.nil? || searcher.is_a?(Varejonline::Searcher::Administrative::CompanySearcher)
|
|
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
|
+
def find(id)
|
|
16
|
+
return parse_response(self.class.get("/#{id}", body: build_body, headers: header))
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Varejonline
|
|
2
|
+
module API
|
|
3
|
+
class CreditLimits < Client
|
|
4
|
+
require_all 'varejonline/searcher/commercial', 'credit_limit_searcher'
|
|
5
|
+
|
|
6
|
+
base_uri "#{Varejonline::API_ADDRESS}/limites_credito"
|
|
7
|
+
|
|
8
|
+
def list(searcher = nil)
|
|
9
|
+
raise ArgumentError unless searcher.nil? || searcher.is_a?(Varejonline::Searcher::Commercial::CreditLimitSearcher)
|
|
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
|
+
def block_history(third_party_id, start_date, end_date)
|
|
16
|
+
return parse_response(self.class.get('/historico_bloqueio', body: build_body({'desde' => start_date, 'ate' => end_date, 'idTerceiro' => third_party_id}), headers: header))
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Varejonline
|
|
2
|
+
module API
|
|
3
|
+
class DefaultEntries < Client
|
|
4
|
+
require_all 'varejonline/searcher/financial', 'default_entry_searcher'
|
|
5
|
+
|
|
6
|
+
base_uri "#{Varejonline::API_ADDRESS}/lancamentos-padroes"
|
|
7
|
+
|
|
8
|
+
def list(searcher = nil)
|
|
9
|
+
raise ArgumentError unless searcher.nil? || searcher.is_a?(Varejonline::Searcher::Financial::DefaultEntrySearcher)
|
|
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
|
+
def find(id)
|
|
16
|
+
return parse_response(self.class.get("/#{id}", body: build_body, headers: header))
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Varejonline
|
|
2
|
+
module API
|
|
3
|
+
class Entities < Client
|
|
4
|
+
require_all 'varejonline/searcher/administrative', 'entity_searcher'
|
|
5
|
+
|
|
6
|
+
base_uri "#{Varejonline::API_ADDRESS}/entidades"
|
|
7
|
+
|
|
8
|
+
def list(searcher = nil)
|
|
9
|
+
raise ArgumentError unless searcher.nil? || searcher.is_a?(Varejonline::Searcher::Administrative::EntitySearcher)
|
|
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
|
+
def find(id)
|
|
16
|
+
return parse_response(self.class.get("/#{id}", body: build_body, headers: header))
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Varejonline
|
|
2
|
+
module API
|
|
3
|
+
class Installments < Client
|
|
4
|
+
require_all 'varejonline/entity/commercial', 'installment'
|
|
5
|
+
|
|
6
|
+
base_uri "#{Varejonline::API_ADDRESS}/configuracao-credito"
|
|
7
|
+
|
|
8
|
+
def configure(id, data)
|
|
9
|
+
return parse_response(self.class.put("/#{id}", body: build_body(data), headers: header))
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def information
|
|
13
|
+
return parse_response(self.class.get('/', body: build_body, headers: header))
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module Varejonline
|
|
2
|
+
module API
|
|
3
|
+
class Orders < Client
|
|
4
|
+
require_all 'varejonline/searcher/operational', 'order_searcher'
|
|
5
|
+
require_all 'varejonline/entity/commercial', 'order', 'item'
|
|
6
|
+
|
|
7
|
+
base_uri "#{Varejonline::API_ADDRESS}/pedidos"
|
|
8
|
+
|
|
9
|
+
def list(searcher = nil)
|
|
10
|
+
raise ArgumentError unless searcher.nil? || searcher.is_a?(Varejonline::Searcher::Operational::OrderSearcher)
|
|
11
|
+
|
|
12
|
+
return parse_response(self.class.get('/', body: build_body(searcher.as_parameter), headers: header)) if searcher
|
|
13
|
+
return parse_response(self.class.get('/', body: build_body, headers: header)) unless searcher
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def find(id)
|
|
17
|
+
return parse_response(self.class.get("/#{id}", body: build_body, headers: header))
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def save(order)
|
|
21
|
+
raise ArgumentError unless order.nil? || order.is_a?(Varejonline::Entity::Commercial::Order)
|
|
22
|
+
return parse_response(self.class.post('/', body: build_body(order.as_parameter), headers: header))
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module Varejonline
|
|
2
|
+
module API
|
|
3
|
+
class PaymentConditions < Client
|
|
4
|
+
require_all 'varejonline/searcher/financial', 'payment_condition_searcher'
|
|
5
|
+
|
|
6
|
+
base_uri "#{Varejonline::API_ADDRESS}/planos-pagamento"
|
|
7
|
+
|
|
8
|
+
def list(searcher = nil)
|
|
9
|
+
raise ArgumentError unless searcher.nil? || searcher.is_a?(Varejonline::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
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module Varejonline
|
|
2
|
+
module API
|
|
3
|
+
class ProductCategories < Client
|
|
4
|
+
require_all 'varejonline/entity/operational', 'product_category'
|
|
5
|
+
|
|
6
|
+
base_uri "#{Varejonline::API_ADDRESS}/categorias-produto"
|
|
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,17 @@
|
|
|
1
|
+
module Varejonline
|
|
2
|
+
module API
|
|
3
|
+
class Products < Client
|
|
4
|
+
require_all 'varejonline/entity/commercial', 'product'
|
|
5
|
+
|
|
6
|
+
base_uri "#{Varejonline::API_ADDRESS}/produtos"
|
|
7
|
+
|
|
8
|
+
def save(data)
|
|
9
|
+
return parse_response(self.class.post('/', body: build_body(data.as_parameter), headers: header))
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def update(id, data)
|
|
13
|
+
return parse_response(self.class.put("/#{id}", body: build_body(data.as_parameter), headers: header))
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module Varejonline
|
|
2
|
+
module API
|
|
3
|
+
class Provisions < Client
|
|
4
|
+
base_uri "#{Varejonline::API_ADDRESS}/provisoes-contas"
|
|
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
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Varejonline
|
|
2
|
+
module API
|
|
3
|
+
class Receipts < Client
|
|
4
|
+
require_all 'varejonline/searcher/financial', 'receipt_searcher'
|
|
5
|
+
|
|
6
|
+
base_uri "#{Varejonline::API_ADDRESS}/contas-receber"
|
|
7
|
+
|
|
8
|
+
def list(searcher = nil)
|
|
9
|
+
raise ArgumentError unless searcher.nil? || searcher.is_a?(Varejonline::Searcher::Financial::ReceiptSearcher)
|
|
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
|
+
def find(id)
|
|
16
|
+
return parse_response(self.class.get("/#{id}", body: build_body, headers: header))
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Varejonline
|
|
2
|
+
module API
|
|
3
|
+
class SalesHistory < Client
|
|
4
|
+
base_uri "#{Varejonline::API_ADDRESS}/externa/historico-vendas-terceiro"
|
|
5
|
+
|
|
6
|
+
def find(id)
|
|
7
|
+
return parse_response(self.class.get("/buscar?terceiro=#{id}", body: build_body, headers: header))
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def more_details(idTerceiro)
|
|
11
|
+
return parse_response(self.class.get("/detalhar?terceiro=#{idTerceiro}", body: build_body, headers: header))
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Varejonline
|
|
2
|
+
module API
|
|
3
|
+
class Sellers < Client
|
|
4
|
+
require_all 'varejonline/searcher/operational', 'seller_searcher'
|
|
5
|
+
|
|
6
|
+
base_uri "#{Varejonline::API_ADDRESS}/representantes"
|
|
7
|
+
|
|
8
|
+
def list(searcher = nil)
|
|
9
|
+
raise ArgumentError unless searcher.nil? || searcher.is_a?(Varejonline::Searcher::Operational::SellerSearcher)
|
|
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
|
+
def find(id)
|
|
16
|
+
return parse_response(self.class.get("/#{id}", body: build_body, headers: header))
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
module Varejonline
|
|
2
|
+
module API
|
|
3
|
+
class ThirdParties < Client
|
|
4
|
+
require_all 'varejonline/searcher/administrative', 'third_party_searcher'
|
|
5
|
+
require_all 'varejonline/entity/administrative', 'third_party', 'address', 'phone'
|
|
6
|
+
require_all 'varejonline/entity/commercial', 'credit_limit'
|
|
7
|
+
|
|
8
|
+
base_uri "#{Varejonline::API_ADDRESS}/terceiros"
|
|
9
|
+
|
|
10
|
+
def list(searcher = nil)
|
|
11
|
+
raise ArgumentError unless searcher.nil? || searcher.is_a?(Varejonline::Searcher::Administrative::ThirdPartySearcher)
|
|
12
|
+
|
|
13
|
+
return parse_response(self.class.get('/', body: build_body(searcher.as_parameter), headers: header)) if searcher
|
|
14
|
+
return parse_response(self.class.get('/', body: build_body, headers: header)) unless searcher
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def find(id)
|
|
18
|
+
return parse_response(self.class.get("/#{id}", body: build_body, headers: header))
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def create(data)
|
|
22
|
+
return parse_response(self.class.post('/', body: build_body(data), headers: header)) if data.is_a?(Hash)
|
|
23
|
+
return parse_response(self.class.post('/', body: build_body(data.as_parameter), headers: header)) if data.is_a?(Varejonline::Entity::Administrative::ThirdParty)
|
|
24
|
+
|
|
25
|
+
raise ArgumentError
|
|
26
|
+
end
|
|
27
|
+
alias :new :create
|
|
28
|
+
|
|
29
|
+
def update(id, data)
|
|
30
|
+
return parse_response(self.class.put("/#{id}", body: build_body(data), headers: header)) if data.is_a?(Hash)
|
|
31
|
+
return parse_response(self.class.put("/#{id}", body: build_body(data.as_parameter), headers: header)) if data.is_a?(Varejonline::Entity::Administrative::ThirdParty)
|
|
32
|
+
|
|
33
|
+
raise ArgumentError
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def credit_limit_information(id)
|
|
37
|
+
return parse_response(self.class.get("/#{id}/limites_credito", body: build_body, headers: header))
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def update_credit_limit(id, data)
|
|
41
|
+
return parse_response(self.class.put("/#{id}/limites_credito/#{id}", body: build_body(data), headers: header)) if data.is_a?(Hash)
|
|
42
|
+
return parse_response(self.class.put("/#{id}/limites_credito/#{id}", body: build_body(data.as_parameter), headers: header)) if data.is_a?(Varejonline::Entity::Commercial::CreditLimit)
|
|
43
|
+
|
|
44
|
+
raise ArgumentError
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def block_credit_limit(id, justification)
|
|
48
|
+
return parse_response(self.class.put("/#{id}/limites_credito/bloquear", body: build_body( {"motivo" => justification} ), headers: header))
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def unlock_credit_limit(id, justification)
|
|
52
|
+
return parse_response(self.class.put("/#{id}/limites_credito/desbloquear", body: build_body( {"motivo" => justification} ), headers: header))
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
require "httparty"
|
|
2
|
+
|
|
3
|
+
module Varejonline
|
|
4
|
+
class Client
|
|
5
|
+
extend Varejonline::ClassMethods
|
|
6
|
+
include HTTParty
|
|
7
|
+
|
|
8
|
+
#debug_output $stdout
|
|
9
|
+
|
|
10
|
+
default_options.update(verify: false)
|
|
11
|
+
parser Proc.new {|b| JSON.parse(b) rescue b}
|
|
12
|
+
|
|
13
|
+
require_all 'varejonline/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',
|
|
15
|
+
'payment_conditions'
|
|
16
|
+
|
|
17
|
+
attr_accessor :access_token
|
|
18
|
+
|
|
19
|
+
def initialize(access_token)
|
|
20
|
+
raise NoAccessTokenError if access_token.nil? || access_token.strip == ""
|
|
21
|
+
@access_token = access_token
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def third_parties
|
|
25
|
+
Varejonline::API::ThirdParties.new(@access_token)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def entities
|
|
29
|
+
Varejonline::API::Entities.new(@access_token)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def default_entries
|
|
33
|
+
Varejonline::API::DefaultEntries.new(@access_token)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def provisions
|
|
37
|
+
Varejonline::API::Provisions.new(@access_token)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def user_data
|
|
41
|
+
Varejonline::API::UserData.new(@access_token)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def installments
|
|
45
|
+
Varejonline::API::Installments.new(@access_token)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def credit_limits
|
|
49
|
+
Varejonline::API::CreditLimits.new(@access_token)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def receipts
|
|
53
|
+
Varejonline::API::Receipts.new(@access_token)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def client_classes
|
|
57
|
+
Varejonline::API::ClientClasses.new(@access_token)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def sales_history
|
|
61
|
+
Varejonline::API::SalesHistory.new(@access_token)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def orders
|
|
65
|
+
Varejonline::API::Orders.new(@access_token)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def companies
|
|
69
|
+
Varejonline::API::Companies.new(@access_token)
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def sellers
|
|
73
|
+
Varejonline::API::Sellers.new(@access_token)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def products
|
|
77
|
+
Varejonline::API::Products.new(@access_token)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def category_levels
|
|
81
|
+
Varejonline::API::CategoryLevels.new(@access_token)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def product_categories
|
|
85
|
+
Varejonline::API::ProductCategories.new(@access_token)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def payment_conditions
|
|
89
|
+
Varejonline::API::PaymentConditions.new(@access_token)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
protected
|
|
93
|
+
def header
|
|
94
|
+
{'Content-Type' => 'application/json', 'Accept' => 'application/json'}
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def build_body(parameters = {})
|
|
98
|
+
parameters.merge(token: @access_token).to_json
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def parse_response(response)
|
|
102
|
+
return Varejonline::Client::Response.new(response)
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
class Response
|
|
106
|
+
attr_accessor :status, :payload, :raw_response
|
|
107
|
+
|
|
108
|
+
def initialize(response)
|
|
109
|
+
@status = response.code
|
|
110
|
+
@payload = response.parsed_response
|
|
111
|
+
@raw_response = response
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
class NoAccessTokenError < StandardError
|
|
116
|
+
def message
|
|
117
|
+
'Please provide an access token'
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require 'varejonline/entity/base'
|
|
2
|
+
|
|
3
|
+
module Varejonline
|
|
4
|
+
module Entity
|
|
5
|
+
module Administrative
|
|
6
|
+
class ThirdParty < Base
|
|
7
|
+
attr_accessor :id, :nome, :documento, :emails, :rg, :dataNascimento, :ie, :enderecos, :telefones, :classes
|
|
8
|
+
|
|
9
|
+
def initialize(*h)
|
|
10
|
+
self.emails = Array.new
|
|
11
|
+
self.enderecos = Array.new
|
|
12
|
+
self.telefones = Array.new
|
|
13
|
+
self.classes = Array.new
|
|
14
|
+
|
|
15
|
+
super
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def as_parameter
|
|
19
|
+
variables = instance_variables.map do |name|
|
|
20
|
+
case name
|
|
21
|
+
when :@enderecos, :@telefones
|
|
22
|
+
[name.to_s.tr("@", ""), instance_variable_get(name).map(&:as_parameter)]
|
|
23
|
+
else
|
|
24
|
+
[name.to_s.tr("@", ""), instance_variable_get(name)]
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
Hash[variables.compact]
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'varejonline/init_from_hash'
|
|
2
|
+
|
|
3
|
+
module Varejonline
|
|
4
|
+
module Entity
|
|
5
|
+
class Base
|
|
6
|
+
include Varejonline::InitFromHash
|
|
7
|
+
|
|
8
|
+
def as_parameter
|
|
9
|
+
variables = instance_variables.map do |name|
|
|
10
|
+
variable_name = name.to_s.tr("@", "")
|
|
11
|
+
|
|
12
|
+
[variable_name, instance_variable_get(name)]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
Hash[variables]
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require 'varejonline/entity/base'
|
|
2
|
+
|
|
3
|
+
module Varejonline
|
|
4
|
+
module Entity
|
|
5
|
+
module Commercial
|
|
6
|
+
class Installment < Base
|
|
7
|
+
attr_accessor :"bloquearClienteSemAnalise", :bloqueioAutomatico, :"mensagemBloqueio", :"permissaoValorExcedente"
|
|
8
|
+
attr_accessor :"permiteLiberarBloqueioManual", :"permiteVenderSemAnalise"
|
|
9
|
+
attr_accessor :"creditoMaximoCliente", :"valorCredMaximoCliente", :"limiteMensal", :limiteCreditoSobreRenda, :limiteSobreRenda
|
|
10
|
+
attr_accessor :totalCredito
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
require 'varejonline/entity/base'
|
|
2
|
+
|
|
3
|
+
module Varejonline
|
|
4
|
+
module Entity
|
|
5
|
+
module Commercial
|
|
6
|
+
class Order < Base
|
|
7
|
+
attr_accessor :data, :horario, :idEntidade, :idPlanoPagamento, :idRepresentante, :idTerceiro,
|
|
8
|
+
:observacao, :valorFrete, :valorOutros, :valorSeguro, :vendaConsumidorFinal, :itens
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'varejonline/entity/base'
|
|
2
|
+
|
|
3
|
+
module Varejonline
|
|
4
|
+
module Entity
|
|
5
|
+
module Commercial
|
|
6
|
+
class Product < Base
|
|
7
|
+
attr_accessor :descricao, :classificacao, :origem, :fci, :metodoControle, :unidade, :custoReferencial, :codigoNcm
|
|
8
|
+
attr_accessor :cnpjFornecedores, :especificacao, :codigoBarras, :codigoInterno, :codigoSistema, :estoqueMaximo
|
|
9
|
+
attr_accessor :estoqueMinimo, :ativo, :descontoMaximo, :comissao, :preco, :categorias
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
require 'varejonline/entity/base'
|
|
2
|
+
|
|
3
|
+
module Varejonline
|
|
4
|
+
module Entity
|
|
5
|
+
module Operational
|
|
6
|
+
class CategoryLevel < Base
|
|
7
|
+
attr_accessor :id, :ativo, :dataAlteracao, :nome, :nivel, :compoeReferenciaBase, :idNivelCategoriaProdutoPai
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
require 'varejonline/entity/base'
|
|
2
|
+
|
|
3
|
+
module Varejonline
|
|
4
|
+
module Entity
|
|
5
|
+
module Operational
|
|
6
|
+
class ProductCategory < Base
|
|
7
|
+
attr_accessor :id, :ativo, :dataAlteracao, :nome, :origem, :unidade, :metodoControle, :classificacao, :categoriaPai, :nivel
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'varejonline/init_from_hash'
|
|
2
|
+
|
|
3
|
+
module Varejonline
|
|
4
|
+
module Searcher
|
|
5
|
+
class Base
|
|
6
|
+
include InitFromHash
|
|
7
|
+
|
|
8
|
+
attr_accessor :inicio, :quantidade
|
|
9
|
+
|
|
10
|
+
def as_parameter
|
|
11
|
+
variables = instance_variables.map do |name|
|
|
12
|
+
variable_name = name.to_s.tr("@", "")
|
|
13
|
+
|
|
14
|
+
[variable_name, instance_variable_get(name)]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
Hash[variables]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
data/varejonline.gemspec
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'varejonline/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "varejonline"
|
|
8
|
+
spec.version = Varejonline::VERSION
|
|
9
|
+
spec.authors = ["Coyô"]
|
|
10
|
+
spec.email = ["ti@coyo.com.br"]
|
|
11
|
+
|
|
12
|
+
spec.summary = %q{Integração com as APIs do Varejonline}
|
|
13
|
+
spec.description = %q{Integração com as APIs do Varejonline, para mais informações sobre a API, acesse: https://github.com/Varejonline/api/wiki}
|
|
14
|
+
spec.homepage = "https://github.com/coyosoftware/varejonline"
|
|
15
|
+
|
|
16
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
|
17
|
+
# delete this section to allow pushing this gem to any host.
|
|
18
|
+
if spec.respond_to?(:metadata)
|
|
19
|
+
spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
|
20
|
+
else
|
|
21
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
25
|
+
spec.bindir = "exe"
|
|
26
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
27
|
+
spec.require_paths = ["lib"]
|
|
28
|
+
|
|
29
|
+
spec.add_development_dependency "bundler"
|
|
30
|
+
|
|
31
|
+
spec.add_dependency('httparty', "~> 0.14")
|
|
32
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: varejonline
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Coyô
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2017-01-20 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - '>='
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - '>='
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: httparty
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ~>
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0.14'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ~>
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0.14'
|
|
41
|
+
description: 'Integração com as APIs do Varejonline, para mais informações sobre a
|
|
42
|
+
API, acesse: https://github.com/Varejonline/api/wiki'
|
|
43
|
+
email:
|
|
44
|
+
- ti@coyo.com.br
|
|
45
|
+
executables: []
|
|
46
|
+
extensions: []
|
|
47
|
+
extra_rdoc_files: []
|
|
48
|
+
files:
|
|
49
|
+
- .gitignore
|
|
50
|
+
- .rspec
|
|
51
|
+
- .travis.yml
|
|
52
|
+
- Gemfile
|
|
53
|
+
- README.md
|
|
54
|
+
- Rakefile
|
|
55
|
+
- bin/console
|
|
56
|
+
- bin/setup
|
|
57
|
+
- lib/varejonline.rb
|
|
58
|
+
- lib/varejonline/api/category_levels.rb
|
|
59
|
+
- lib/varejonline/api/client_classes.rb
|
|
60
|
+
- lib/varejonline/api/companies.rb
|
|
61
|
+
- lib/varejonline/api/credit_limits.rb
|
|
62
|
+
- lib/varejonline/api/default_entries.rb
|
|
63
|
+
- lib/varejonline/api/entities.rb
|
|
64
|
+
- lib/varejonline/api/installments.rb
|
|
65
|
+
- lib/varejonline/api/orders.rb
|
|
66
|
+
- lib/varejonline/api/payment_conditions.rb
|
|
67
|
+
- lib/varejonline/api/product_categories.rb
|
|
68
|
+
- lib/varejonline/api/products.rb
|
|
69
|
+
- lib/varejonline/api/provisions.rb
|
|
70
|
+
- lib/varejonline/api/receipts.rb
|
|
71
|
+
- lib/varejonline/api/sales_history.rb
|
|
72
|
+
- lib/varejonline/api/sellers.rb
|
|
73
|
+
- lib/varejonline/api/third_parties.rb
|
|
74
|
+
- lib/varejonline/api/user_data.rb
|
|
75
|
+
- lib/varejonline/client.rb
|
|
76
|
+
- lib/varejonline/entity/administrative/address.rb
|
|
77
|
+
- lib/varejonline/entity/administrative/phone.rb
|
|
78
|
+
- lib/varejonline/entity/administrative/third_party.rb
|
|
79
|
+
- lib/varejonline/entity/base.rb
|
|
80
|
+
- lib/varejonline/entity/commercial/credit_limit.rb
|
|
81
|
+
- lib/varejonline/entity/commercial/installment.rb
|
|
82
|
+
- lib/varejonline/entity/commercial/item.rb
|
|
83
|
+
- lib/varejonline/entity/commercial/order.rb
|
|
84
|
+
- lib/varejonline/entity/commercial/product.rb
|
|
85
|
+
- lib/varejonline/entity/operational/category_level.rb
|
|
86
|
+
- lib/varejonline/entity/operational/product_category.rb
|
|
87
|
+
- lib/varejonline/init_from_hash.rb
|
|
88
|
+
- lib/varejonline/searcher/administrative/company_searcher.rb
|
|
89
|
+
- lib/varejonline/searcher/administrative/entity_searcher.rb
|
|
90
|
+
- lib/varejonline/searcher/administrative/third_party_searcher.rb
|
|
91
|
+
- lib/varejonline/searcher/base.rb
|
|
92
|
+
- lib/varejonline/searcher/commercial/credit_limit_searcher.rb
|
|
93
|
+
- lib/varejonline/searcher/financial/default_entry_searcher.rb
|
|
94
|
+
- lib/varejonline/searcher/financial/payment_condition_searcher.rb
|
|
95
|
+
- lib/varejonline/searcher/financial/receipt_searcher.rb
|
|
96
|
+
- lib/varejonline/searcher/operational/client_class_searcher.rb
|
|
97
|
+
- lib/varejonline/searcher/operational/order_searcher.rb
|
|
98
|
+
- lib/varejonline/searcher/operational/seller_searcher.rb
|
|
99
|
+
- lib/varejonline/version.rb
|
|
100
|
+
- varejonline.gemspec
|
|
101
|
+
homepage: https://github.com/coyosoftware/varejonline
|
|
102
|
+
licenses: []
|
|
103
|
+
metadata:
|
|
104
|
+
allowed_push_host: https://rubygems.org
|
|
105
|
+
post_install_message:
|
|
106
|
+
rdoc_options: []
|
|
107
|
+
require_paths:
|
|
108
|
+
- lib
|
|
109
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
110
|
+
requirements:
|
|
111
|
+
- - '>='
|
|
112
|
+
- !ruby/object:Gem::Version
|
|
113
|
+
version: '0'
|
|
114
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
|
+
requirements:
|
|
116
|
+
- - '>='
|
|
117
|
+
- !ruby/object:Gem::Version
|
|
118
|
+
version: '0'
|
|
119
|
+
requirements: []
|
|
120
|
+
rubyforge_project:
|
|
121
|
+
rubygems_version: 2.4.6
|
|
122
|
+
signing_key:
|
|
123
|
+
specification_version: 4
|
|
124
|
+
summary: Integração com as APIs do Varejonline
|
|
125
|
+
test_files: []
|