pagseguro-transparente 0.0.1
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/.DS_Store +0 -0
- data/.gitignore +34 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +89 -0
- data/README.md +79 -0
- data/Rakefile +5 -0
- data/coverage/.last_run.json +5 -0
- data/coverage/.resultset.json +1665 -0
- data/coverage/assets/0.8.0/application.css +799 -0
- data/coverage/assets/0.8.0/application.js +1559 -0
- data/coverage/assets/0.8.0/colorbox/border.png +0 -0
- data/coverage/assets/0.8.0/colorbox/controls.png +0 -0
- data/coverage/assets/0.8.0/colorbox/loading.gif +0 -0
- data/coverage/assets/0.8.0/colorbox/loading_background.png +0 -0
- data/coverage/assets/0.8.0/favicon_green.png +0 -0
- data/coverage/assets/0.8.0/favicon_red.png +0 -0
- data/coverage/assets/0.8.0/favicon_yellow.png +0 -0
- data/coverage/assets/0.8.0/loading.gif +0 -0
- data/coverage/assets/0.8.0/magnify.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/coverage/index.html +10198 -0
- data/lib/pagseguro/address.rb +46 -0
- data/lib/pagseguro/bank.rb +15 -0
- data/lib/pagseguro/credit_card.rb +23 -0
- data/lib/pagseguro/document.rb +20 -0
- data/lib/pagseguro/exceptions.rb +22 -0
- data/lib/pagseguro/holder.rb +24 -0
- data/lib/pagseguro/installment.rb +17 -0
- data/lib/pagseguro/item.rb +29 -0
- data/lib/pagseguro/items.rb +16 -0
- data/lib/pagseguro/notification/address.rb +43 -0
- data/lib/pagseguro/notification/item.rb +14 -0
- data/lib/pagseguro/notification/items.rb +18 -0
- data/lib/pagseguro/notification/payment_method.rb +19 -0
- data/lib/pagseguro/notification/phone.rb +19 -0
- data/lib/pagseguro/notification/sender.rb +23 -0
- data/lib/pagseguro/notification/shipping.rb +23 -0
- data/lib/pagseguro/notification.rb +82 -0
- data/lib/pagseguro/phone.rb +21 -0
- data/lib/pagseguro/request.rb +21 -0
- data/lib/pagseguro/sender.rb +28 -0
- data/lib/pagseguro/session/response.rb +15 -0
- data/lib/pagseguro/session.rb +7 -0
- data/lib/pagseguro/shipping.rb +23 -0
- data/lib/pagseguro/transaction/serializer.rb +158 -0
- data/lib/pagseguro/transaction.rb +91 -0
- data/lib/pagseguro/version.rb +3 -0
- data/lib/pagseguro-transparente.rb +1 -0
- data/lib/pagseguro.rb +54 -0
- data/pagseguro-transparente.gemspec +34 -0
- data/spec/pagseguro/address_spec.rb +35 -0
- data/spec/pagseguro/bank_spec.rb +17 -0
- data/spec/pagseguro/credit_card_spec.rb +18 -0
- data/spec/pagseguro/document_spec.rb +18 -0
- data/spec/pagseguro/holder_spec.rb +18 -0
- data/spec/pagseguro/installment_spec.rb +14 -0
- data/spec/pagseguro/item_spec.rb +28 -0
- data/spec/pagseguro/items_spec.rb +13 -0
- data/spec/pagseguro/notification/address_spec.rb +33 -0
- data/spec/pagseguro/notification/item_spec.rb +15 -0
- data/spec/pagseguro/notification/items_spec.rb +31 -0
- data/spec/pagseguro/notification/payment_method_spec.rb +21 -0
- data/spec/pagseguro/notification/phone_spec.rb +21 -0
- data/spec/pagseguro/notification/sender_spec.rb +26 -0
- data/spec/pagseguro/notification/shipping_spec.rb +22 -0
- data/spec/pagseguro/notification_spec.rb +45 -0
- data/spec/pagseguro/pagseguro_spec.rb +23 -0
- data/spec/pagseguro/phone_spec.rb +19 -0
- data/spec/pagseguro/sender_spec.rb +20 -0
- data/spec/pagseguro/session/response_spec.rb +17 -0
- data/spec/pagseguro/session_spec.rb +23 -0
- data/spec/pagseguro/shipping_spec.rb +22 -0
- data/spec/pagseguro/transaction/serializer_spec.rb +131 -0
- data/spec/pagseguro/transaction_spec.rb +91 -0
- data/spec/spec_helper.rb +16 -0
- metadata +311 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 41aeb32eecad44bc12bc65c52a1b2d5e137afe98
|
|
4
|
+
data.tar.gz: 78b0d8036ddd8f8b1682578119c51f8b74dbc4b7
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 1a5ce341133a6dd352b4fe18c9ad1391443d349455c3176aface2e0c0c36e6b61a7f64079ab1abc8811a6cf3268e337bcaed458beb3e6ed9092aabacd35c46c2
|
|
7
|
+
data.tar.gz: eba3dbe5a1d3cb9072c9a1f905c9ce6fc01c6954811da89b4d93a0c61fb53a2f4da4c6dd91cf272eb14e70b1c15dbc191195dae0f2eef75ff53be6f9a6c21b1a
|
data/.DS_Store
ADDED
|
Binary file
|
data/.gitignore
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
*.gem
|
|
2
|
+
*.rbc
|
|
3
|
+
/.config
|
|
4
|
+
/coverage/
|
|
5
|
+
/InstalledFiles
|
|
6
|
+
/pkg/
|
|
7
|
+
/spec/reports/
|
|
8
|
+
/test/tmp/
|
|
9
|
+
/test/version_tmp/
|
|
10
|
+
/tmp/
|
|
11
|
+
|
|
12
|
+
## Specific to RubyMotion:
|
|
13
|
+
.dat*
|
|
14
|
+
.repl_history
|
|
15
|
+
build/
|
|
16
|
+
|
|
17
|
+
## Documentation cache and generated files:
|
|
18
|
+
/.yardoc/
|
|
19
|
+
/_yardoc/
|
|
20
|
+
/doc/
|
|
21
|
+
/rdoc/
|
|
22
|
+
|
|
23
|
+
## Environment normalisation:
|
|
24
|
+
/.bundle/
|
|
25
|
+
/lib/bundler/man/
|
|
26
|
+
|
|
27
|
+
# for a library or gem, you might want to ignore these files since the code is
|
|
28
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
29
|
+
# Gemfile.lock
|
|
30
|
+
# .ruby-version
|
|
31
|
+
# .ruby-gemset
|
|
32
|
+
|
|
33
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
|
34
|
+
.rvmrc
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
pagseguro-transparente (0.0.1)
|
|
5
|
+
activemodel
|
|
6
|
+
httparty
|
|
7
|
+
json
|
|
8
|
+
nokogiri
|
|
9
|
+
|
|
10
|
+
GEM
|
|
11
|
+
remote: https://rubygems.org/
|
|
12
|
+
specs:
|
|
13
|
+
activemodel (4.1.0)
|
|
14
|
+
activesupport (= 4.1.0)
|
|
15
|
+
builder (~> 3.1)
|
|
16
|
+
activesupport (4.1.0)
|
|
17
|
+
i18n (~> 0.6, >= 0.6.9)
|
|
18
|
+
json (~> 1.7, >= 1.7.7)
|
|
19
|
+
minitest (~> 5.1)
|
|
20
|
+
thread_safe (~> 0.1)
|
|
21
|
+
tzinfo (~> 1.1)
|
|
22
|
+
addressable (2.3.6)
|
|
23
|
+
atomic (1.1.16)
|
|
24
|
+
builder (3.2.2)
|
|
25
|
+
coveralls (0.7.0)
|
|
26
|
+
multi_json (~> 1.3)
|
|
27
|
+
rest-client
|
|
28
|
+
simplecov (>= 0.7)
|
|
29
|
+
term-ansicolor
|
|
30
|
+
thor
|
|
31
|
+
crack (0.4.2)
|
|
32
|
+
safe_yaml (~> 1.0.0)
|
|
33
|
+
diff-lcs (1.2.5)
|
|
34
|
+
docile (1.1.3)
|
|
35
|
+
httparty (0.13.1)
|
|
36
|
+
json (~> 1.8)
|
|
37
|
+
multi_xml (>= 0.5.2)
|
|
38
|
+
i18n (0.6.9)
|
|
39
|
+
json (1.8.1)
|
|
40
|
+
mime-types (2.2)
|
|
41
|
+
mini_portile (0.5.3)
|
|
42
|
+
minitest (5.3.3)
|
|
43
|
+
multi_json (1.9.2)
|
|
44
|
+
multi_xml (0.5.5)
|
|
45
|
+
nokogiri (1.6.1)
|
|
46
|
+
mini_portile (~> 0.5.0)
|
|
47
|
+
rake (10.3.0)
|
|
48
|
+
rest-client (1.6.7)
|
|
49
|
+
mime-types (>= 1.16)
|
|
50
|
+
rspec (2.14.1)
|
|
51
|
+
rspec-core (~> 2.14.0)
|
|
52
|
+
rspec-expectations (~> 2.14.0)
|
|
53
|
+
rspec-mocks (~> 2.14.0)
|
|
54
|
+
rspec-core (2.14.8)
|
|
55
|
+
rspec-expectations (2.14.5)
|
|
56
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
|
57
|
+
rspec-mocks (2.14.6)
|
|
58
|
+
safe_yaml (1.0.2)
|
|
59
|
+
shoulda-matchers (2.5.0)
|
|
60
|
+
activesupport (>= 3.0.0)
|
|
61
|
+
simplecov (0.8.2)
|
|
62
|
+
docile (~> 1.1.0)
|
|
63
|
+
multi_json
|
|
64
|
+
simplecov-html (~> 0.8.0)
|
|
65
|
+
simplecov-html (0.8.0)
|
|
66
|
+
term-ansicolor (1.3.0)
|
|
67
|
+
tins (~> 1.0)
|
|
68
|
+
thor (0.19.1)
|
|
69
|
+
thread_safe (0.2.0)
|
|
70
|
+
atomic (>= 1.1.7, < 2)
|
|
71
|
+
tins (1.1.0)
|
|
72
|
+
tzinfo (1.1.0)
|
|
73
|
+
thread_safe (~> 0.1)
|
|
74
|
+
webmock (1.17.4)
|
|
75
|
+
addressable (>= 2.2.7)
|
|
76
|
+
crack (>= 0.3.2)
|
|
77
|
+
|
|
78
|
+
PLATFORMS
|
|
79
|
+
ruby
|
|
80
|
+
|
|
81
|
+
DEPENDENCIES
|
|
82
|
+
bundler
|
|
83
|
+
coveralls
|
|
84
|
+
pagseguro-transparente!
|
|
85
|
+
rake
|
|
86
|
+
rspec
|
|
87
|
+
shoulda-matchers (= 2.5.0)
|
|
88
|
+
thread_safe (= 0.2.0)
|
|
89
|
+
webmock
|
data/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# PagSeguro Transparente
|
|
2
|
+
|
|
3
|
+
Gem para a utilização do novo checkout transparente do Pagseguro.
|
|
4
|
+
|
|
5
|
+
[](https://travis-ci.org/eventick/pagseguro-transparente)
|
|
6
|
+
[](https://coveralls.io/r/eventick/pagseguro-transparente)
|
|
7
|
+
[](https://codeclimate.com/github/eventick/pagseguro-transparente)
|
|
8
|
+
[](https://gemnasium.com/eventick/pagseguro-transparente)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Sobre o PagSeguro
|
|
13
|
+
|
|
14
|
+
PagSeguro é a solução completa para pagamentos online, que garante a segurança de quem compra e de quem vende na web. Quem compra com PagSeguro tem a garantia de produto ou serviço entregue ou seu dinheiro de volta. Quem vende utilizando o serviço do PagSeguro tem o gerenciamento de risco de suas transações*. Quem integra lojas ao PagSeguro tem ferramentas, comissão e publicidade gratuita.
|
|
15
|
+
|
|
16
|
+
## Requisitos
|
|
17
|
+
Ruby >= 1.9.3
|
|
18
|
+
Rails >= 3.0
|
|
19
|
+
|
|
20
|
+
##Como usar
|
|
21
|
+
|
|
22
|
+
Adicione a biblioteca ao arquivo Gemfile:
|
|
23
|
+
~~~.ruby
|
|
24
|
+
gem "pagseguro-transparente", "~> 0.0.1"
|
|
25
|
+
~~~
|
|
26
|
+
* Ainda não publicada, é preciso baixar direto do Github.
|
|
27
|
+
|
|
28
|
+
Criar um initializer em config/initializer/pagseguro.rb
|
|
29
|
+
~~~.ruby
|
|
30
|
+
PagSeguro.configure do |config|
|
|
31
|
+
config.email = "exemplo@pagseguro.com.br"
|
|
32
|
+
config.token = "token válido"
|
|
33
|
+
end
|
|
34
|
+
~~~
|
|
35
|
+
|
|
36
|
+
##Criando uma nova sessão
|
|
37
|
+
~~~.ruby
|
|
38
|
+
pagseguro_session = PagSeguro::Session.new
|
|
39
|
+
@pagseguro_session_id = pagseguro_session.create.id
|
|
40
|
+
~~~
|
|
41
|
+
|
|
42
|
+
##Criando uma transação
|
|
43
|
+
~~~.ruby
|
|
44
|
+
transaction = PagSeguro::Transaction.new(notification_url: 'www.eventick.com.br', payment_method: 'boleto', reference: '1')
|
|
45
|
+
items = [PagSeguro::Item.new(1, 'Ingresso Teste', 2, 1)]
|
|
46
|
+
transaction.items = items
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
phone = PagSeguro::Phone.new('81', '97550129')
|
|
50
|
+
document = PagSeguro::Document.new('01735536300')
|
|
51
|
+
|
|
52
|
+
sender = PagSeguro::Sender.new(email: 'cirdes@gmail.com', name: 'Cirdes Henrique', hash_id: )
|
|
53
|
+
sender.phone = phone
|
|
54
|
+
sender.document = document
|
|
55
|
+
|
|
56
|
+
transaction.sender = sender
|
|
57
|
+
|
|
58
|
+
address = PagSeguro::Address.new(postal_code: '52050040', street: 'Rua Teles Junior', number: '475', complement: '301', district: 'rosarinho', city: 'Recife', state: 'PE')
|
|
59
|
+
shipping = PagSeguro::Shipping.new
|
|
60
|
+
shipping.address = address
|
|
61
|
+
|
|
62
|
+
transaction.shipping = shipping
|
|
63
|
+
|
|
64
|
+
response = transaction.register
|
|
65
|
+
|
|
66
|
+
response.payment_link
|
|
67
|
+
~~~
|
|
68
|
+
|
|
69
|
+
Você deve redirecionar o usário para a url retornada para compras com boleto e débito bancário.
|
|
70
|
+
|
|
71
|
+
This is a working in progress!
|
|
72
|
+
|
|
73
|
+
## Contributing
|
|
74
|
+
|
|
75
|
+
1. Fork it
|
|
76
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
77
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
78
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
79
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED