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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11bba32d43c99a567044072534e32b1812f9c08a
4
- data.tar.gz: 1aaa3e0e1c0722ec7eea18b436b915a23738fddc
3
+ metadata.gz: 4170aa38a44e8206018c539e5e6b4ff9d54579de
4
+ data.tar.gz: 1c72022a5253f4666a50b1f06c597042e12da5fa
5
5
  SHA512:
6
- metadata.gz: 10a6e5180c4e2f547d34c567cadb0ccfd56a046c9ca987a46515a31d2eae2620525c47578b219bc8489955cba92566c0e1a3af5204a1015ba830d9cc4daa0228
7
- data.tar.gz: b280148152866d688c78a68cb634220d9ce0995a3ae01da6468e043b30f87585c81c5fc6e7fbbb2e847dd0a3c2e7d755cb451b061888e17e9188604adf53fedc
6
+ metadata.gz: bdd8be8877306dbc16db0c1ea33dfcb31ca19cdf6e53610a18a9257b18edc042ed7a4b3954c8aec8d57bffcef632ac9a6abf7def713975792b002b6615bc525e
7
+ data.tar.gz: 8385fbda591adc755dce8374f9c8ea6b862ec54e71ffd0e6d8d16f581230bc664c9da54ef9e9865b07443d820a9881a00ee00ac4adf9cbfa46cf81b4dc425a22
data/Gemfile CHANGED
@@ -2,3 +2,9 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in e4commerce.gemspec
4
4
  gemspec
5
+
6
+ gem 'boletosimples'
7
+ gem 'dalli'
8
+ gem "pagseguro-oficial"
9
+
10
+
data/Gemfile.lock CHANGED
@@ -1,19 +1,64 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- e4commerce (0.1.1)
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
- <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
1
+ # E4commerce
2
2
 
3
- # Framework Desenho de Software Grupo 4
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
- ## Sobre o projeto
7
+ Adicione a linha abaixo no seu GemFile:
7
8
 
8
- <p align="justify">O projeto tem como objetivo a criação de um framework para ser utilizado em projetos que envolvem e-commerce, de forma a oferecer diversas vantagens para quem utilizá-lo.
9
+ ```ruby
10
+ gem 'e4commerce'
11
+ ```
9
12
 
10
- ## Instalação
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
- ## Licença
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
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/e4commerce`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Write usage instructions here
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/[USERNAME]/e4commerce.
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
- require "bundler/gem_tasks"
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
+
@@ -1,3 +1,3 @@
1
1
  module E4commerce
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -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.1.1
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-19 00:00:00.000000000 Z
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
@@ -1,3 +0,0 @@
1
- task :ask do
2
- puts "test"
3
- end
File without changes