e4commerce 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -0
- data/Gemfile.lock +46 -1
- data/README.md +36 -14
- data/Rakefile +3 -9
- data/lib/e4commerce/config/initializers.rb +14 -1
- data/lib/e4commerce/version.rb +1 -1
- data/lib/tasks/boleto.rake +92 -0
- data/lib/tasks/pagseguro.rake +42 -0
- data/lib/tasks/product.rake +19 -0
- metadata +5 -4
- data/lib/e4commerce/PagSeguro/pagseguro.rake +0 -3
- data/lib/e4commerce/PagSeguro/pagseguro.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4170aa38a44e8206018c539e5e6b4ff9d54579de
|
4
|
+
data.tar.gz: 1c72022a5253f4666a50b1f06c597042e12da5fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdd8be8877306dbc16db0c1ea33dfcb31ca19cdf6e53610a18a9257b18edc042ed7a4b3954c8aec8d57bffcef632ac9a6abf7def713975792b002b6615bc525e
|
7
|
+
data.tar.gz: 8385fbda591adc755dce8374f9c8ea6b862ec54e71ffd0e6d8d16f581230bc664c9da54ef9e9865b07443d820a9881a00ee00ac4adf9cbfa46cf81b4dc425a22
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,19 +1,64 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
e4commerce (0.
|
4
|
+
e4commerce (0.2.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
+
activemodel (5.1.1)
|
10
|
+
activesupport (= 5.1.1)
|
11
|
+
activesupport (5.1.1)
|
12
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
|
+
i18n (~> 0.7)
|
14
|
+
minitest (~> 5.1)
|
15
|
+
tzinfo (~> 1.1)
|
16
|
+
aitch (0.5.0)
|
17
|
+
nokogiri (>= 1.6.0)
|
18
|
+
boletosimples (0.4.1)
|
19
|
+
faraday-http-cache (~> 1.3.1)
|
20
|
+
faraday_middleware (~> 0.10.0)
|
21
|
+
her (~> 0.8.1)
|
22
|
+
concurrent-ruby (1.0.5)
|
23
|
+
dalli (2.7.6)
|
24
|
+
faraday (0.12.1)
|
25
|
+
multipart-post (>= 1.2, < 3)
|
26
|
+
faraday-http-cache (1.3.1)
|
27
|
+
faraday (~> 0.8)
|
28
|
+
faraday_middleware (0.10.1)
|
29
|
+
faraday (>= 0.7.4, < 1.0)
|
30
|
+
her (0.8.6)
|
31
|
+
activemodel (>= 3.0.0, <= 6.0.0)
|
32
|
+
activesupport (>= 3.0.0, <= 6.0.0)
|
33
|
+
faraday (>= 0.8, < 1.0)
|
34
|
+
multi_json (~> 1.7)
|
35
|
+
i18n (0.8.4)
|
36
|
+
json (1.8.6)
|
37
|
+
mini_portile2 (2.2.0)
|
38
|
+
minitest (5.10.2)
|
39
|
+
multi_json (1.12.1)
|
40
|
+
multipart-post (2.0.0)
|
41
|
+
nokogiri (1.8.0)
|
42
|
+
mini_portile2 (~> 2.2.0)
|
43
|
+
pagseguro-oficial (2.6.0)
|
44
|
+
aitch (~> 0.2)
|
45
|
+
i18n (~> 0.7)
|
46
|
+
json (~> 1.8)
|
47
|
+
nokogiri (~> 1.6)
|
9
48
|
rake (10.5.0)
|
49
|
+
thread_safe (0.3.6)
|
50
|
+
tzinfo (1.2.3)
|
51
|
+
thread_safe (~> 0.1)
|
10
52
|
|
11
53
|
PLATFORMS
|
12
54
|
ruby
|
13
55
|
|
14
56
|
DEPENDENCIES
|
57
|
+
boletosimples
|
15
58
|
bundler (~> 1.14)
|
59
|
+
dalli
|
16
60
|
e4commerce!
|
61
|
+
pagseguro-oficial
|
17
62
|
rake (~> 10.0)
|
18
63
|
|
19
64
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -1,27 +1,49 @@
|
|
1
|
-
|
1
|
+
# E4commerce
|
2
2
|
|
3
|
-
|
3
|
+
O e4commerce tem como objetivo fornecer uma ferramenta que facilite no desenvolvimento de um commerce. Voltada ao público brasileiro procurar fornecer formas de pagamento de acordo com as normas nacionais.
|
4
4
|
|
5
|
+
## Instalação
|
5
6
|
|
6
|
-
|
7
|
+
Adicione a linha abaixo no seu GemFile:
|
7
8
|
|
8
|
-
|
9
|
+
```ruby
|
10
|
+
gem 'e4commerce'
|
11
|
+
```
|
9
12
|
|
10
|
-
|
13
|
+
Então execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Ou instale isto por meio do seguinte comando:
|
18
|
+
|
19
|
+
$ gem install e4commerce
|
20
|
+
|
21
|
+
## Utilização
|
22
|
+
|
23
|
+
Para informações de uso, acesse: [Manual de Uso](https://github.com/miguelpimentel/e4commerce/wiki/Manual-de-Uso)
|
24
|
+
|
25
|
+
## Desenvolvimento
|
26
|
+
|
27
|
+
Depois de checar o repositório, execute `bin/setup` para instalar suas dependências. Você também pode executar bin/console` para experimentar.
|
28
|
+
|
29
|
+
Para instalar esta gem em sua máquina local, execute run `bundle exec rake install`. Para lançar uma nova versão, atualize o número da versão no aruivo `version.rb`, e então executar `bundle exec rake release`, o qual cria uma tag git para a versão e cria um push nos comitts e tags. Por fim, dê um push no arquivo .gem para [rubygems.org](https://rubygems.org).
|
30
|
+
|
31
|
+
## Contribuição
|
32
|
+
|
33
|
+
|
34
|
+
Reportar bugs e pull requestes são bem-vindos em nosso repositório oficial: GitHub at https://github.com/miguelpimentel/e4commerce.
|
35
|
+
|
36
|
+
|
37
|
+
## Licensa
|
11
38
|
|
12
|
-
|
13
|
-
[MIT](https://opensource.org/licenses/MIT)
|
39
|
+
Esta gem está disponível como open source de acordo com os termos da [licensa MIT](http://opensource.org/licenses/MIT).
|
14
40
|
|
15
|
-
<p align="center">Grupo 4 - Desenho de Software 2017/1<br /><br />
|
16
|
-
<a href="https://fga.unb.br" target="_blank"><img width="200"src="https://4.bp.blogspot.com/-0aa6fAFnSnA/VzICtBQgciI/AAAAAAAARn4/SxVsQPFNeE0fxkCPVgMWbhd5qIEAYCMbwCLcB/s1600/unb-gama.png"></a>
|
17
|
-
</p>
|
18
41
|
|
19
42
|
|
20
43
|
# E4commerce
|
21
44
|
|
22
|
-
|
45
|
+
The e4commerce aims to create a simple tool for ecommerce development. This gem is made for brazilians developers according with brazilian financial rules.
|
23
46
|
|
24
|
-
TODO: Delete this and the text above, and describe your gem
|
25
47
|
|
26
48
|
## Installation
|
27
49
|
|
@@ -41,7 +63,7 @@ Or install it yourself as:
|
|
41
63
|
|
42
64
|
## Usage
|
43
65
|
|
44
|
-
|
66
|
+
For more info, acess: [e4commerce documentation](https://github.com/miguelpimentel/e4commerce/wiki/Manual-de-Uso)
|
45
67
|
|
46
68
|
## Development
|
47
69
|
|
@@ -51,7 +73,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
51
73
|
|
52
74
|
## Contributing
|
53
75
|
|
54
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
76
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/miguelpimentel/e4commerce.
|
55
77
|
|
56
78
|
|
57
79
|
## License
|
data/Rakefile
CHANGED
@@ -1,17 +1,11 @@
|
|
1
|
-
|
1
|
+
# Load all rake files in tasks
|
2
|
+
Dir.glob('lib/tasks/*.rake').each { |r| load r}
|
2
3
|
|
4
|
+
require "bundler/gem_tasks"
|
3
5
|
|
4
6
|
task :default => :spec
|
5
7
|
|
6
|
-
namespace :payment do
|
7
8
|
|
8
|
-
task :pagseguro do
|
9
|
-
|
10
|
-
ps = PagSeguroPayment.new
|
11
|
-
ps.test
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|
15
9
|
|
16
10
|
|
17
11
|
|
@@ -1,6 +1,19 @@
|
|
1
|
+
require 'boletosimples'
|
2
|
+
require 'dalli'
|
3
|
+
|
1
4
|
PagSeguro.configure do |config|
|
2
5
|
config.token = "seu token"
|
3
6
|
config.email = "seu e-mail"
|
4
7
|
config.environment = :production # ou :sandbox. O padrão é production.
|
5
8
|
config.encoding = "UTF-8" # ou ISO-8859-1. O padrão é UTF-8.
|
6
|
-
end
|
9
|
+
end
|
10
|
+
|
11
|
+
BoletoSimples.configure do |c|
|
12
|
+
c.environment = :production # defaut :sandbox
|
13
|
+
c.access_token = 'access-token'
|
14
|
+
end
|
15
|
+
|
16
|
+
BoletoSimples.configure do |c|
|
17
|
+
c.cache = ActiveSupport::Cache.lookup_store(:dalli_store, ['localhost:11211'], namespace: 'boletosimples_client', compress: true)
|
18
|
+
end
|
19
|
+
|
data/lib/e4commerce/version.rb
CHANGED
@@ -0,0 +1,92 @@
|
|
1
|
+
#module Boleto
|
2
|
+
|
3
|
+
# def self.generate
|
4
|
+
|
5
|
+
# end
|
6
|
+
|
7
|
+
#end
|
8
|
+
|
9
|
+
|
10
|
+
#namespace :boleto do
|
11
|
+
# namespace :banco_do_brasil do
|
12
|
+
# namespace :pag_seguro do
|
13
|
+
# task :generate_boleto do
|
14
|
+
# puts "Here must be generate boleto of banco do brasil with pagseguro"
|
15
|
+
# end
|
16
|
+
# end
|
17
|
+
# namespace :padrao do
|
18
|
+
# task :generate_boleto do
|
19
|
+
# puts "Here must be generate boleto of banco do brasil padrao"
|
20
|
+
# @bank_billet = BoletoSimples::BankBillet.create({
|
21
|
+
# amount: ,#inserir valor,
|
22
|
+
# description: '', #inserir descrição
|
23
|
+
# expire_at: '', #inserir data de vencimento
|
24
|
+
# customer_address: '', #endereco do cliente
|
25
|
+
# customer_address_complement: '', #complemento do endereco do cliente
|
26
|
+
# customer_address_number: '', #número do endereço do cliente
|
27
|
+
# customer_city_name: '', #inserir cidade do cliente
|
28
|
+
# customer_cnpj_cpf: '', #inserir CPF do cliente
|
29
|
+
# customer_email: '', #inserir email do cliente
|
30
|
+
# customer_neighborhood: '', #bairro do cliente
|
31
|
+
# customer_person_name: '', #nome do cliente
|
32
|
+
# customer_person_type: 'individual',
|
33
|
+
# customer_phone_number: '',#telefone
|
34
|
+
# customer_state: '', #estado
|
35
|
+
# customer_zipcode: '' #CEP do cliente
|
36
|
+
# })
|
37
|
+
#
|
38
|
+
# end
|
39
|
+
# end
|
40
|
+
# end
|
41
|
+
|
42
|
+
# namespace :banco_itau do
|
43
|
+
# namespace :pag_seguro do
|
44
|
+
|
45
|
+
# end
|
46
|
+
# namespace :padrao do
|
47
|
+
# @bank_billet = BoletoSimples::BankBillet.create({
|
48
|
+
# amount: ,#inserir valor,
|
49
|
+
# description: '', #inserir descrição
|
50
|
+
# expire_at: '', #inserir data de vencimento
|
51
|
+
# customer_address: '', #endereco do cliente
|
52
|
+
# customer_address_complement: '', #complemento do endereco do cliente
|
53
|
+
# customer_address_number: '', #número do endereço do cliente
|
54
|
+
# customer_city_name: '', #inserir cidade do cliente
|
55
|
+
# customer_cnpj_cpf: '', #inserir CPF do cliente
|
56
|
+
# customer_email: '', #inserir email do cliente
|
57
|
+
# customer_neighborhood: '', #bairro do cliente
|
58
|
+
# customer_person_name: '', #nome do cliente
|
59
|
+
# customer_person_type: 'individual',
|
60
|
+
# customer_phone_number: '',#telefone
|
61
|
+
# customer_state: '', #estado
|
62
|
+
# customer_zipcode: '' #CEP do cliente
|
63
|
+
# })
|
64
|
+
# end
|
65
|
+
# end
|
66
|
+
|
67
|
+
# namespace :banco_bradesco do
|
68
|
+
# namespace :pag_seguro do
|
69
|
+
|
70
|
+
# end
|
71
|
+
# namespace :padrao do
|
72
|
+
# @bank_billet = BoletoSimples::BankBillet.create({
|
73
|
+
# amount: ,#inserir valor,
|
74
|
+
# description: '', #inserir descrição
|
75
|
+
# expire_at: '', #inserir data de vencimento
|
76
|
+
# customer_address: '', #endereco do cliente
|
77
|
+
# customer_address_complement: '', #complemento do endereco do cliente
|
78
|
+
# customer_address_number: '', #número do endereço do cliente
|
79
|
+
# customer_city_name: '', #inserir cidade do cliente
|
80
|
+
# customer_cnpj_cpf: '', #inserir CPF do cliente
|
81
|
+
# customer_email: '', #inserir email do cliente
|
82
|
+
# customer_neighborhood: '', #bairro do cliente
|
83
|
+
# customer_person_name: '', #nome do cliente
|
84
|
+
# customer_person_type: 'individual',
|
85
|
+
# customer_phone_number: '',#telefone
|
86
|
+
# customer_state: '', #estado
|
87
|
+
# customer_zipcode: '' #CEP do cliente
|
88
|
+
# })
|
89
|
+
# end
|
90
|
+
# end
|
91
|
+
#end
|
92
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
task ('one') do
|
2
|
+
puts "one"
|
3
|
+
end
|
4
|
+
|
5
|
+
task({'two' => ['one']}) do
|
6
|
+
puts 'two'
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
task ({'file ' => ['pagseguro']}) do
|
11
|
+
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
task :thing, [:foo] do |task, args|
|
16
|
+
puts args[:foo]
|
17
|
+
end
|
18
|
+
|
19
|
+
file :pagseguro, [:token] => :environment do |file, args|
|
20
|
+
|
21
|
+
new_line = "\n"
|
22
|
+
content = ""
|
23
|
+
tab = " "
|
24
|
+
|
25
|
+
content = content + "PagSeguro.configure do |config|" + new_line
|
26
|
+
|
27
|
+
content = content + tab + "config.token = " + (args[:token]) + new_line
|
28
|
+
content = content + tab + "config.email = " + (args[:token]) + new_line
|
29
|
+
content = content + tab + "config.environment = #production" + new_line
|
30
|
+
content = content + tab + "config.email = #UTF-8" + new_line
|
31
|
+
|
32
|
+
content = content + "end" + new_line
|
33
|
+
|
34
|
+
aux = "lib/tasks/pagseguro.rb"
|
35
|
+
|
36
|
+
puts "CREATED " + aux + new_line
|
37
|
+
|
38
|
+
File.open(aux, "w+") { |file| file.write(content) }
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Product
|
2
|
+
|
3
|
+
def self.generate
|
4
|
+
|
5
|
+
end
|
6
|
+
|
7
|
+
end
|
8
|
+
|
9
|
+
task :environment do
|
10
|
+
puts "Setting up environment"
|
11
|
+
end
|
12
|
+
|
13
|
+
namespace :product do
|
14
|
+
desc "All taks related to products"
|
15
|
+
task :generate_product, [:name, :price, :image_url] => [:environment] do |t, args|
|
16
|
+
puts "Here goes the code that generates products, yet create model Product"
|
17
|
+
puts "product: ", args
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: e4commerce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Pimentel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -57,12 +57,13 @@ files:
|
|
57
57
|
- e4commerce.gemspec
|
58
58
|
- lib/builder.rb
|
59
59
|
- lib/e4commerce.rb
|
60
|
-
- lib/e4commerce/PagSeguro/pagseguro.rake
|
61
|
-
- lib/e4commerce/PagSeguro/pagseguro.rb
|
62
60
|
- lib/e4commerce/app/controllers/application_controller.rb
|
63
61
|
- lib/e4commerce/app/controllers/pagseguro_controller.rb
|
64
62
|
- lib/e4commerce/config/initializers.rb
|
65
63
|
- lib/e4commerce/version.rb
|
64
|
+
- lib/tasks/boleto.rake
|
65
|
+
- lib/tasks/pagseguro.rake
|
66
|
+
- lib/tasks/product.rake
|
66
67
|
homepage: https://github.com/miguelpimentel/e4commerce
|
67
68
|
licenses:
|
68
69
|
- MIT
|
File without changes
|