catarse_paypal_express 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/Gemfile.lock +73 -77
- data/README.md +7 -0
- data/app/controllers/catarse_paypal_express/paypal_express_controller.rb +7 -7
- data/app/views/catarse_paypal_express/paypal_express/review.html.slim +1 -1
- data/catarse_paypal_express.gemspec +4 -4
- data/config/initializers/register.rb +1 -1
- data/config/routes.rb +4 -4
- data/lib/catarse_paypal_express/version.rb +1 -1
- data/lib/catarse_paypal_express.rb +1 -0
- data/spec/controllers/catarse_paypal_express/paypal_express_controller_spec.rb +17 -17
- data/test/dummy/config/application.rb +3 -38
- data/test/dummy/config/database.yml +3 -5
- data/test/dummy/config/environments/development.rb +11 -19
- data/test/dummy/config/environments/production.rb +40 -27
- data/test/dummy/config/environments/test.rb +13 -14
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +6 -5
- data/test/dummy/config/initializers/secret_token.rb +7 -2
- data/test/dummy/config/initializers/session_store.rb +0 -5
- data/test/dummy/config/initializers/wrap_parameters.rb +6 -6
- metadata +12 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b89329023598b1ed9e39384aa566a45f533002f5
|
4
|
+
data.tar.gz: 8e101b28b9165382f8da2f5af956230f195d5fbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21c800b9c57b8902797d48b075deb2e1d46759cb7db39ec70f8342014b336fedfd53a17e735697457c53b433f2334a40026800523f0307d5b6872dd6f8f40777
|
7
|
+
data.tar.gz: af28d53d3843797abf0f215ebba738c390676b99cd7c979790a67da68c10d0002937de6676ef0f2564ad60563ba9654c341f8a27a794b8aed1e15ac43a76aa4a
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,55 +1,53 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
catarse_paypal_express (
|
5
|
-
activemerchant (>= 1.
|
6
|
-
rails (~>
|
4
|
+
catarse_paypal_express (2.0.0)
|
5
|
+
activemerchant (>= 1.34.0)
|
6
|
+
rails (~> 4.0)
|
7
7
|
slim-rails
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actionmailer (
|
13
|
-
actionpack (=
|
12
|
+
actionmailer (4.0.0)
|
13
|
+
actionpack (= 4.0.0)
|
14
14
|
mail (~> 2.5.3)
|
15
|
-
actionpack (
|
16
|
-
|
17
|
-
|
18
|
-
builder (~> 3.0.0)
|
15
|
+
actionpack (4.0.0)
|
16
|
+
activesupport (= 4.0.0)
|
17
|
+
builder (~> 3.1.0)
|
19
18
|
erubis (~> 2.7.0)
|
20
|
-
|
21
|
-
rack (~>
|
22
|
-
|
23
|
-
rack-test (~> 0.6.1)
|
24
|
-
sprockets (~> 2.2.1)
|
25
|
-
active_utils (1.0.5)
|
19
|
+
rack (~> 1.5.2)
|
20
|
+
rack-test (~> 0.6.2)
|
21
|
+
active_utils (2.0.0)
|
26
22
|
activesupport (>= 2.3.11)
|
27
23
|
i18n
|
28
|
-
activemerchant (1.
|
24
|
+
activemerchant (1.36.0)
|
29
25
|
active_utils (>= 1.0.2)
|
30
26
|
activesupport (>= 2.3.14)
|
31
27
|
builder (>= 2.0.0)
|
32
28
|
i18n
|
33
29
|
json (>= 1.5.1)
|
34
30
|
money
|
35
|
-
nokogiri
|
36
|
-
activemodel (
|
37
|
-
activesupport (=
|
38
|
-
builder (~> 3.
|
39
|
-
activerecord (
|
40
|
-
activemodel (=
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
31
|
+
nokogiri (< 1.6.0)
|
32
|
+
activemodel (4.0.0)
|
33
|
+
activesupport (= 4.0.0)
|
34
|
+
builder (~> 3.1.0)
|
35
|
+
activerecord (4.0.0)
|
36
|
+
activemodel (= 4.0.0)
|
37
|
+
activerecord-deprecated_finders (~> 1.0.2)
|
38
|
+
activesupport (= 4.0.0)
|
39
|
+
arel (~> 4.0.0)
|
40
|
+
activerecord-deprecated_finders (1.0.3)
|
41
|
+
activesupport (4.0.0)
|
42
|
+
i18n (~> 0.6, >= 0.6.4)
|
43
|
+
minitest (~> 4.2)
|
44
|
+
multi_json (~> 1.3)
|
45
|
+
thread_safe (~> 0.1)
|
46
|
+
tzinfo (~> 0.3.37)
|
47
|
+
arel (4.0.0)
|
48
|
+
atomic (1.1.13)
|
49
|
+
builder (3.1.4)
|
50
|
+
database_cleaner (1.1.1)
|
53
51
|
diff-lcs (1.2.4)
|
54
52
|
erubis (2.7.0)
|
55
53
|
factory_girl (4.2.0)
|
@@ -57,71 +55,69 @@ GEM
|
|
57
55
|
factory_girl_rails (4.2.1)
|
58
56
|
factory_girl (~> 4.2.0)
|
59
57
|
railties (>= 3.0.0)
|
60
|
-
hike (1.2.
|
61
|
-
i18n (0.6.
|
62
|
-
journey (1.0.4)
|
58
|
+
hike (1.2.3)
|
59
|
+
i18n (0.6.5)
|
63
60
|
json (1.8.0)
|
64
61
|
mail (2.5.4)
|
65
62
|
mime-types (~> 1.16)
|
66
63
|
treetop (~> 1.4.8)
|
67
64
|
mime-types (1.24)
|
65
|
+
minitest (4.7.5)
|
68
66
|
money (5.1.1)
|
69
67
|
i18n (~> 0.6.0)
|
70
|
-
multi_json (1.7.
|
71
|
-
nokogiri (1.5.
|
72
|
-
pg (0.
|
68
|
+
multi_json (1.7.9)
|
69
|
+
nokogiri (1.5.10)
|
70
|
+
pg (0.16.0)
|
73
71
|
polyglot (0.3.3)
|
74
|
-
rack (1.
|
75
|
-
rack-cache (1.2)
|
76
|
-
rack (>= 0.4)
|
77
|
-
rack-ssl (1.3.3)
|
78
|
-
rack
|
72
|
+
rack (1.5.2)
|
79
73
|
rack-test (0.6.2)
|
80
74
|
rack (>= 1.0)
|
81
|
-
rails (
|
82
|
-
actionmailer (=
|
83
|
-
actionpack (=
|
84
|
-
activerecord (=
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
railties (
|
90
|
-
actionpack (=
|
91
|
-
activesupport (=
|
92
|
-
rack-ssl (~> 1.3.2)
|
75
|
+
rails (4.0.0)
|
76
|
+
actionmailer (= 4.0.0)
|
77
|
+
actionpack (= 4.0.0)
|
78
|
+
activerecord (= 4.0.0)
|
79
|
+
activesupport (= 4.0.0)
|
80
|
+
bundler (>= 1.3.0, < 2.0)
|
81
|
+
railties (= 4.0.0)
|
82
|
+
sprockets-rails (~> 2.0.0)
|
83
|
+
railties (4.0.0)
|
84
|
+
actionpack (= 4.0.0)
|
85
|
+
activesupport (= 4.0.0)
|
93
86
|
rake (>= 0.8.7)
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
json (~> 1.4)
|
99
|
-
rspec-core (2.13.1)
|
100
|
-
rspec-expectations (2.13.0)
|
87
|
+
thor (>= 0.18.1, < 2.0)
|
88
|
+
rake (10.1.0)
|
89
|
+
rspec-core (2.14.5)
|
90
|
+
rspec-expectations (2.14.2)
|
101
91
|
diff-lcs (>= 1.1.3, < 2.0)
|
102
|
-
rspec-mocks (2.
|
103
|
-
rspec-rails (2.
|
92
|
+
rspec-mocks (2.14.3)
|
93
|
+
rspec-rails (2.14.0)
|
104
94
|
actionpack (>= 3.0)
|
105
95
|
activesupport (>= 3.0)
|
106
96
|
railties (>= 3.0)
|
107
|
-
rspec-core (~> 2.
|
108
|
-
rspec-expectations (~> 2.
|
109
|
-
rspec-mocks (~> 2.
|
110
|
-
slim (
|
111
|
-
temple (~> 0.6.
|
112
|
-
tilt (
|
113
|
-
slim-rails (
|
97
|
+
rspec-core (~> 2.14.0)
|
98
|
+
rspec-expectations (~> 2.14.0)
|
99
|
+
rspec-mocks (~> 2.14.0)
|
100
|
+
slim (2.0.1)
|
101
|
+
temple (~> 0.6.6)
|
102
|
+
tilt (>= 1.3.3, < 2.1)
|
103
|
+
slim-rails (2.0.1)
|
114
104
|
actionpack (>= 3.0, < 4.1)
|
115
105
|
activesupport (>= 3.0, < 4.1)
|
116
106
|
railties (>= 3.0, < 4.1)
|
117
|
-
slim (~>
|
118
|
-
sprockets (2.
|
107
|
+
slim (~> 2.0)
|
108
|
+
sprockets (2.10.0)
|
119
109
|
hike (~> 1.2)
|
120
110
|
multi_json (~> 1.0)
|
121
111
|
rack (~> 1.0)
|
122
112
|
tilt (~> 1.1, != 1.3.0)
|
123
|
-
|
113
|
+
sprockets-rails (2.0.0)
|
114
|
+
actionpack (>= 3.0)
|
115
|
+
activesupport (>= 3.0)
|
116
|
+
sprockets (~> 2.8)
|
117
|
+
temple (0.6.6)
|
124
118
|
thor (0.18.1)
|
119
|
+
thread_safe (0.1.2)
|
120
|
+
atomic
|
125
121
|
tilt (1.4.1)
|
126
122
|
treetop (1.4.14)
|
127
123
|
polyglot
|
@@ -137,5 +133,5 @@ DEPENDENCIES
|
|
137
133
|
database_cleaner
|
138
134
|
factory_girl_rails
|
139
135
|
pg
|
140
|
-
rspec-rails
|
136
|
+
rspec-rails (~> 2.14.0)
|
141
137
|
slim-rails
|
data/README.md
CHANGED
@@ -18,6 +18,13 @@ Configure the routes for your Catarse application. Add the following lines in th
|
|
18
18
|
|
19
19
|
mount CatarsePaypalExpress::Engine => "/", :as => "catarse_paypal_express"
|
20
20
|
|
21
|
+
## Rails 3.2.x and Rails 4 support
|
22
|
+
|
23
|
+
If you are using the Rails 3.2.x on Catarse's code, you can use the version `1.0.0`.
|
24
|
+
|
25
|
+
For Rails 4 support use the `2.0.0` version.
|
26
|
+
|
27
|
+
|
21
28
|
### Configurations
|
22
29
|
|
23
30
|
Create this configurations into Catarse database:
|
@@ -25,11 +25,11 @@ class CatarsePaypalExpress::PaypalExpressController < ApplicationController
|
|
25
25
|
begin
|
26
26
|
response = gateway.setup_purchase(backer.price_in_cents, {
|
27
27
|
ip: request.remote_ip,
|
28
|
-
return_url:
|
29
|
-
cancel_return_url:
|
28
|
+
return_url: success_paypal_express_url(id: backer.id),
|
29
|
+
cancel_return_url: cancel_paypal_express_url(id: backer.id),
|
30
30
|
currency_code: 'BRL',
|
31
31
|
description: t('paypal_description', scope: SCOPE, :project_name => backer.project.name, :value => backer.display_value),
|
32
|
-
notify_url:
|
32
|
+
notify_url: ipn_paypal_express_index_url
|
33
33
|
})
|
34
34
|
|
35
35
|
process_paypal_message response.params
|
@@ -53,7 +53,7 @@ class CatarsePaypalExpress::PaypalExpressController < ApplicationController
|
|
53
53
|
|
54
54
|
# we must get the deatils after the purchase in order to get the transaction_id
|
55
55
|
process_paypal_message purchase.params
|
56
|
-
backer.update_attributes payment_id: purchase.params['transaction_id'] if purchase.params['transaction_id']
|
56
|
+
backer.update_attributes payment_id: purchase.params['transaction_id'] if purchase.params['transaction_id']
|
57
57
|
|
58
58
|
flash[:success] = t('success', scope: SCOPE)
|
59
59
|
redirect_to main_app.project_backer_path(project_id: backer.project.id, id: backer.id)
|
@@ -82,17 +82,17 @@ class CatarsePaypalExpress::PaypalExpressController < ApplicationController
|
|
82
82
|
PaymentEngines.create_payment_notification backer_id: backer.id, extra_data: extra_data
|
83
83
|
|
84
84
|
if data["checkout_status"] == 'PaymentActionCompleted'
|
85
|
-
backer.confirm!
|
85
|
+
backer.confirm!
|
86
86
|
elsif data["payment_status"]
|
87
87
|
case data["payment_status"].downcase
|
88
88
|
when 'completed'
|
89
|
-
backer.confirm!
|
89
|
+
backer.confirm!
|
90
90
|
when 'refunded'
|
91
91
|
backer.refund!
|
92
92
|
when 'canceled_reversal'
|
93
93
|
backer.cancel!
|
94
94
|
when 'expired', 'denied'
|
95
|
-
backer.pendent!
|
95
|
+
backer.pendent!
|
96
96
|
else
|
97
97
|
backer.waiting! if backer.pending?
|
98
98
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
h3= t('projects.backers.review.international.section_title')
|
4
4
|
|
5
5
|
#catarse_paypal_express_form
|
6
|
-
= form_tag
|
6
|
+
= form_tag pay_paypal_express_path(params[:id]) do
|
7
7
|
.clearfix
|
8
8
|
.bootstrap-twitter
|
9
9
|
= label_tag 'user_document', t('projects.backers.review.international.user_document_label')
|
@@ -10,18 +10,18 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.version = CatarsePaypalExpress::VERSION
|
11
11
|
s.authors = ["Antônio Roberto Silva", "Diogo Biazus", "Josemar Davi Luedke"]
|
12
12
|
s.email = ["forevertonny@gmail.com", "diogob@gmail.com", "josemarluedke@gmail.com"]
|
13
|
-
s.homepage = "http://github.com/
|
13
|
+
s.homepage = "http://github.com/catarse/catarse_paypal_express"
|
14
14
|
s.summary = "PaypalExpress integration with Catarse"
|
15
15
|
s.description = "PaypalExpress integration with Catarse crowdfunding platform"
|
16
16
|
|
17
17
|
s.files = `git ls-files`.split($\)
|
18
18
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
19
19
|
|
20
|
-
s.add_dependency "rails", "~>
|
21
|
-
s.add_dependency "activemerchant", ">= 1.
|
20
|
+
s.add_dependency "rails", "~> 4.0"
|
21
|
+
s.add_dependency "activemerchant", ">= 1.34.0"
|
22
22
|
s.add_dependency "slim-rails"
|
23
23
|
|
24
|
-
s.add_development_dependency "rspec-rails"
|
24
|
+
s.add_development_dependency "rspec-rails", '~> 2.14.0'
|
25
25
|
s.add_development_dependency "factory_girl_rails"
|
26
26
|
s.add_development_dependency "database_cleaner"
|
27
27
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
begin
|
2
|
-
PaymentEngines.register({name: 'paypal', review_path: ->(backer){ CatarsePaypalExpress::Engine.routes.url_helpers.
|
2
|
+
PaymentEngines.register({name: 'paypal', review_path: ->(backer){ CatarsePaypalExpress::Engine.routes.url_helpers.review_paypal_express_path(backer) }, locale: 'en'})
|
3
3
|
rescue Exception => e
|
4
4
|
puts "Error while registering payment engine: #{e}"
|
5
5
|
end
|
data/config/routes.rb
CHANGED
@@ -18,15 +18,15 @@ describe CatarsePaypalExpress::PaypalExpressController do
|
|
18
18
|
let(:current_user) { double('current_user') }
|
19
19
|
let(:project){ double('project', id: 1, name: 'test project') }
|
20
20
|
let(:backer){ double('backer', {
|
21
|
-
id: 1,
|
22
|
-
key: 'backer key',
|
23
|
-
payment_id: 'payment id',
|
24
|
-
project: project,
|
25
|
-
pending?: true,
|
26
|
-
value: 10,
|
21
|
+
id: 1,
|
22
|
+
key: 'backer key',
|
23
|
+
payment_id: 'payment id',
|
24
|
+
project: project,
|
25
|
+
pending?: true,
|
26
|
+
value: 10,
|
27
27
|
display_value: 'R$ 10,00',
|
28
28
|
price_in_cents: 1000,
|
29
|
-
user: current_user,
|
29
|
+
user: current_user,
|
30
30
|
payer_name: 'foo',
|
31
31
|
payer_email: 'foo@bar.com',
|
32
32
|
payment_token: 'token',
|
@@ -42,7 +42,7 @@ describe CatarsePaypalExpress::PaypalExpressController do
|
|
42
42
|
|
43
43
|
describe "GET review" do
|
44
44
|
before do
|
45
|
-
get :review, id: backer.id, use_route: 'catarse_paypal_express'
|
45
|
+
get :review, id: backer.id, use_route: 'catarse_paypal_express'
|
46
46
|
end
|
47
47
|
it{ should render_template(:review) }
|
48
48
|
end
|
@@ -55,11 +55,11 @@ describe CatarsePaypalExpress::PaypalExpressController do
|
|
55
55
|
before do
|
56
56
|
params = ipn_data.merge({ use_route: 'catarse_paypal_express' })
|
57
57
|
backer.should_receive(:update_attributes).with({
|
58
|
-
payment_service_fee: ipn_data['mc_fee'],
|
58
|
+
payment_service_fee: ipn_data['mc_fee'],
|
59
59
|
payer_email: ipn_data['payer_email']
|
60
60
|
})
|
61
61
|
controller.should_receive(:process_paypal_message).with(ipn_data.merge({
|
62
|
-
"controller"=>"catarse_paypal_express/paypal_express",
|
62
|
+
"controller"=>"catarse_paypal_express/paypal_express",
|
63
63
|
"action"=>"ipn"
|
64
64
|
}))
|
65
65
|
post :ipn, params
|
@@ -69,15 +69,15 @@ describe CatarsePaypalExpress::PaypalExpressController do
|
|
69
69
|
its(:body){ should == ' ' }
|
70
70
|
end
|
71
71
|
|
72
|
-
describe "
|
72
|
+
describe "POST pay" do
|
73
73
|
before do
|
74
74
|
set_paypal_response
|
75
|
-
|
75
|
+
post :pay, { id: backer.id, locale: 'en', use_route: 'catarse_paypal_express' }
|
76
76
|
end
|
77
77
|
|
78
78
|
|
79
79
|
context 'when response raises a exception' do
|
80
|
-
let(:set_paypal_response) do
|
80
|
+
let(:set_paypal_response) do
|
81
81
|
main_app.should_receive(:new_project_backer_path).with(backer.project).and_return('error url')
|
82
82
|
gateway.should_receive(:setup_purchase).and_raise(StandardError)
|
83
83
|
end
|
@@ -88,13 +88,13 @@ describe CatarsePaypalExpress::PaypalExpressController do
|
|
88
88
|
end
|
89
89
|
|
90
90
|
context 'when successul' do
|
91
|
-
let(:set_paypal_response) do
|
91
|
+
let(:set_paypal_response) do
|
92
92
|
success_response = double('success_response', {
|
93
93
|
token: 'ABCD',
|
94
94
|
params: { 'correlation_id' => '123' }
|
95
95
|
})
|
96
96
|
gateway.should_receive(:setup_purchase).with(
|
97
|
-
backer.price_in_cents,
|
97
|
+
backer.price_in_cents,
|
98
98
|
{
|
99
99
|
ip: request.remote_ip,
|
100
100
|
return_url: 'http://test.host/catarse_paypal_express/payment/paypal_express/1/success',
|
@@ -105,7 +105,7 @@ describe CatarsePaypalExpress::PaypalExpressController do
|
|
105
105
|
}
|
106
106
|
).and_return(success_response)
|
107
107
|
backer.should_receive(:update_attributes).with({
|
108
|
-
payment_method: "PayPal",
|
108
|
+
payment_method: "PayPal",
|
109
109
|
payment_token: "ABCD"
|
110
110
|
})
|
111
111
|
gateway.should_receive(:redirect_url_for).with('ABCD').and_return('success url')
|
@@ -244,7 +244,7 @@ describe CatarsePaypalExpress::PaypalExpressController do
|
|
244
244
|
controller.stub(:params).and_return({'id' => 1})
|
245
245
|
PaymentEngines.should_receive(:create_payment_notification).with(backer_id: backer.id, extra_data: data)
|
246
246
|
end
|
247
|
-
|
247
|
+
|
248
248
|
context "when data['checkout_status'] == 'PaymentActionCompleted'" do
|
249
249
|
let(:data){ {'checkout_status' => 'PaymentActionCompleted'} }
|
250
250
|
before do
|
@@ -2,7 +2,9 @@ require File.expand_path('../boot', __FILE__)
|
|
2
2
|
|
3
3
|
require 'rails/all'
|
4
4
|
|
5
|
-
|
5
|
+
# Require the gems listed in Gemfile, including any gems
|
6
|
+
# you've limited to :test, :development, or :production.
|
7
|
+
Bundler.require(:default, Rails.env)
|
6
8
|
|
7
9
|
module Dummy
|
8
10
|
class Application < Rails::Application
|
@@ -10,16 +12,6 @@ module Dummy
|
|
10
12
|
# Application configuration should go into files in config/initializers
|
11
13
|
# -- all .rb files in that directory are automatically loaded.
|
12
14
|
|
13
|
-
# Custom directories with classes and modules you want to be autoloadable.
|
14
|
-
# config.autoload_paths += %W(#{config.root}/extras)
|
15
|
-
|
16
|
-
# Only load the plugins named here, in the order given (default is alphabetical).
|
17
|
-
# :all can be used as a placeholder for all plugins not explicitly named.
|
18
|
-
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
19
|
-
|
20
|
-
# Activate observers that should always be running.
|
21
|
-
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
22
|
-
|
23
15
|
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
24
16
|
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
25
17
|
# config.time_zone = 'Central Time (US & Canada)'
|
@@ -27,32 +19,5 @@ module Dummy
|
|
27
19
|
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
28
20
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
29
21
|
# config.i18n.default_locale = :de
|
30
|
-
|
31
|
-
# Configure the default encoding used in templates for Ruby 1.9.
|
32
|
-
config.encoding = "utf-8"
|
33
|
-
|
34
|
-
# Configure sensitive parameters which will be filtered from the log file.
|
35
|
-
config.filter_parameters += [:password]
|
36
|
-
|
37
|
-
# Enable escaping HTML in JSON.
|
38
|
-
config.active_support.escape_html_entities_in_json = true
|
39
|
-
|
40
|
-
# Use SQL instead of Active Record's schema dumper when creating the database.
|
41
|
-
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
42
|
-
# like if you have constraints or database-specific column types
|
43
|
-
# config.active_record.schema_format = :sql
|
44
|
-
|
45
|
-
# Enforce whitelist mode for mass assignment.
|
46
|
-
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
47
|
-
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
48
|
-
# parameters by using an attr_accessible or attr_protected declaration.
|
49
|
-
config.active_record.whitelist_attributes = true
|
50
|
-
|
51
|
-
# Enable the asset pipeline
|
52
|
-
config.assets.enabled = true
|
53
|
-
|
54
|
-
# Version of your assets, change this if you want to expire all your assets
|
55
|
-
config.assets.version = '1.0'
|
56
22
|
end
|
57
23
|
end
|
58
|
-
|
@@ -13,8 +13,7 @@ development:
|
|
13
13
|
encoding: utf-8
|
14
14
|
database: catarse_development
|
15
15
|
pool: 5
|
16
|
-
|
17
|
-
host: localhost
|
16
|
+
username: catarse
|
18
17
|
|
19
18
|
|
20
19
|
# Connect on a TCP socket. Omitted by default since the client uses a
|
@@ -40,8 +39,7 @@ test: &test
|
|
40
39
|
encoding: utf-8
|
41
40
|
database: catarse_test
|
42
41
|
pool: 5
|
43
|
-
|
44
|
-
host: localhost
|
42
|
+
username: catarse
|
45
43
|
|
46
44
|
|
47
45
|
production:
|
@@ -49,4 +47,4 @@ production:
|
|
49
47
|
encoding: utf-8
|
50
48
|
database: catarse_production
|
51
49
|
pool: 5
|
52
|
-
|
50
|
+
username: catarse
|
@@ -1,37 +1,29 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# In the development environment your application's code is reloaded on
|
5
5
|
# every request. This slows down response time but is perfect for development
|
6
6
|
# since you don't have to restart the web server when you make code changes.
|
7
7
|
config.cache_classes = false
|
8
8
|
|
9
|
-
#
|
10
|
-
config.
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
11
|
|
12
|
-
# Show full error reports and disable caching
|
12
|
+
# Show full error reports and disable caching.
|
13
13
|
config.consider_all_requests_local = true
|
14
14
|
config.action_controller.perform_caching = false
|
15
15
|
|
16
|
-
# Don't care if the mailer can't send
|
16
|
+
# Don't care if the mailer can't send.
|
17
17
|
config.action_mailer.raise_delivery_errors = false
|
18
18
|
|
19
|
-
# Print deprecation notices to the Rails logger
|
19
|
+
# Print deprecation notices to the Rails logger.
|
20
20
|
config.active_support.deprecation = :log
|
21
21
|
|
22
|
-
#
|
23
|
-
config.
|
22
|
+
# Raise an error on page load if there are pending migrations
|
23
|
+
config.active_record.migration_error = :page_load
|
24
24
|
|
25
|
-
#
|
26
|
-
|
27
|
-
|
28
|
-
# Log the query plan for queries taking more than this (works
|
29
|
-
# with SQLite, MySQL, and PostgreSQL)
|
30
|
-
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
31
|
-
|
32
|
-
# Do not compress assets
|
33
|
-
config.assets.compress = false
|
34
|
-
|
35
|
-
# Expands the lines which load the assets
|
25
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
26
|
+
# This option may cause significant delays in view rendering with a large
|
27
|
+
# number of complex assets.
|
36
28
|
config.assets.debug = true
|
37
29
|
end
|
@@ -1,67 +1,80 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
|
-
# Code is not reloaded between requests
|
4
|
+
# Code is not reloaded between requests.
|
5
5
|
config.cache_classes = true
|
6
6
|
|
7
|
-
#
|
7
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both thread web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
8
14
|
config.consider_all_requests_local = false
|
9
15
|
config.action_controller.perform_caching = true
|
10
16
|
|
11
|
-
#
|
17
|
+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
|
+
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
|
20
|
+
# config.action_dispatch.rack_cache = true
|
21
|
+
|
22
|
+
# Disable Rails's static asset server (Apache or nginx will already do this).
|
12
23
|
config.serve_static_assets = false
|
13
24
|
|
14
|
-
# Compress JavaScripts and CSS
|
15
|
-
config.assets.
|
25
|
+
# Compress JavaScripts and CSS.
|
26
|
+
config.assets.js_compressor = :uglifier
|
27
|
+
# config.assets.css_compressor = :sass
|
16
28
|
|
17
|
-
#
|
29
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
18
30
|
config.assets.compile = false
|
19
31
|
|
20
|
-
# Generate digests for assets URLs
|
32
|
+
# Generate digests for assets URLs.
|
21
33
|
config.assets.digest = true
|
22
34
|
|
23
|
-
#
|
24
|
-
|
35
|
+
# Version of your assets, change this if you want to expire all your assets.
|
36
|
+
config.assets.version = '1.0'
|
25
37
|
|
26
|
-
# Specifies the header that your server uses for sending files
|
38
|
+
# Specifies the header that your server uses for sending files.
|
27
39
|
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
28
40
|
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
29
41
|
|
30
42
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
31
43
|
# config.force_ssl = true
|
32
44
|
|
33
|
-
#
|
34
|
-
|
45
|
+
# Set to :debug to see everything in the log.
|
46
|
+
config.log_level = :info
|
35
47
|
|
36
|
-
# Prepend all log lines with the following tags
|
48
|
+
# Prepend all log lines with the following tags.
|
37
49
|
# config.log_tags = [ :subdomain, :uuid ]
|
38
50
|
|
39
|
-
# Use a different logger for distributed setups
|
51
|
+
# Use a different logger for distributed setups.
|
40
52
|
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
41
53
|
|
42
|
-
# Use a different cache store in production
|
54
|
+
# Use a different cache store in production.
|
43
55
|
# config.cache_store = :mem_cache_store
|
44
56
|
|
45
|
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
57
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
46
58
|
# config.action_controller.asset_host = "http://assets.example.com"
|
47
59
|
|
48
|
-
# Precompile additional assets
|
60
|
+
# Precompile additional assets.
|
61
|
+
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
49
62
|
# config.assets.precompile += %w( search.js )
|
50
63
|
|
51
|
-
#
|
64
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
65
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
52
66
|
# config.action_mailer.raise_delivery_errors = false
|
53
67
|
|
54
|
-
# Enable threaded mode
|
55
|
-
# config.threadsafe!
|
56
|
-
|
57
68
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
58
|
-
# the I18n.default_locale when a translation can not be found)
|
69
|
+
# the I18n.default_locale when a translation can not be found).
|
59
70
|
config.i18n.fallbacks = true
|
60
71
|
|
61
|
-
# Send deprecation notices to registered listeners
|
72
|
+
# Send deprecation notices to registered listeners.
|
62
73
|
config.active_support.deprecation = :notify
|
63
74
|
|
64
|
-
#
|
65
|
-
#
|
66
|
-
|
75
|
+
# Disable automatic flushing of the log to improve performance.
|
76
|
+
# config.autoflush_log = false
|
77
|
+
|
78
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
79
|
+
config.log_formatter = ::Logger::Formatter.new
|
67
80
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
5
5
|
# test suite. You never need to work with it otherwise. Remember that
|
@@ -7,31 +7,30 @@ Dummy::Application.configure do
|
|
7
7
|
# and recreated between test runs. Don't rely on the data there!
|
8
8
|
config.cache_classes = true
|
9
9
|
|
10
|
-
#
|
11
|
-
|
12
|
-
|
10
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
11
|
+
# just for the purpose of running a single test. If you are using a tool that
|
12
|
+
# preloads Rails for running tests, you may have to set it to true.
|
13
|
+
config.eager_load = false
|
13
14
|
|
14
|
-
#
|
15
|
-
config.
|
15
|
+
# Configure static asset server for tests with Cache-Control for performance.
|
16
|
+
config.serve_static_assets = true
|
17
|
+
config.static_cache_control = "public, max-age=3600"
|
16
18
|
|
17
|
-
# Show full error reports and disable caching
|
19
|
+
# Show full error reports and disable caching.
|
18
20
|
config.consider_all_requests_local = true
|
19
21
|
config.action_controller.perform_caching = false
|
20
22
|
|
21
|
-
# Raise exceptions instead of rendering exception templates
|
23
|
+
# Raise exceptions instead of rendering exception templates.
|
22
24
|
config.action_dispatch.show_exceptions = false
|
23
25
|
|
24
|
-
# Disable request forgery protection in test environment
|
25
|
-
config.action_controller.allow_forgery_protection
|
26
|
+
# Disable request forgery protection in test environment.
|
27
|
+
config.action_controller.allow_forgery_protection = false
|
26
28
|
|
27
29
|
# Tell Action Mailer not to deliver emails to the real world.
|
28
30
|
# The :test delivery method accumulates sent emails in the
|
29
31
|
# ActionMailer::Base.deliveries array.
|
30
32
|
config.action_mailer.delivery_method = :test
|
31
33
|
|
32
|
-
#
|
33
|
-
config.active_record.mass_assignment_sanitizer = :strict
|
34
|
-
|
35
|
-
# Print deprecation notices to the stderr
|
34
|
+
# Print deprecation notices to the stderr.
|
36
35
|
config.active_support.deprecation = :stderr
|
37
36
|
end
|
@@ -1,15 +1,16 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
|
-
# Add new inflection rules using the following format
|
4
|
-
#
|
5
|
-
#
|
3
|
+
# Add new inflection rules using the following format. Inflections
|
4
|
+
# are locale specific, and you may define rules for as many different
|
5
|
+
# locales as you wish. All of these examples are active by default:
|
6
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
6
7
|
# inflect.plural /^(ox)$/i, '\1en'
|
7
8
|
# inflect.singular /^(ox)en/i, '\1'
|
8
9
|
# inflect.irregular 'person', 'people'
|
9
10
|
# inflect.uncountable %w( fish sheep )
|
10
11
|
# end
|
11
|
-
|
12
|
+
|
12
13
|
# These inflection rules are supported but not enabled by default:
|
13
|
-
# ActiveSupport::Inflector.inflections do |inflect|
|
14
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
14
15
|
# inflect.acronym 'RESTful'
|
15
16
|
# end
|
@@ -1,7 +1,12 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
|
-
# Your secret key for verifying the integrity of signed cookies.
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
4
|
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
5
6
|
# Make sure the secret is at least 30 characters and all random,
|
6
7
|
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure your secret_key_base is kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
Dummy::Application.config.secret_key_base = '56b32f3c2786d84f9dc2a481c726e5a6675e0466e0bd7031322d20df94ec5010c8a488a29f4f0856a10bb02b4117f80ac70429f9926efe0583a1472857bb6421'
|
@@ -1,8 +1,3 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
3
|
Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
|
4
|
-
|
5
|
-
# Use the database for sessions instead of the cookie-based default,
|
6
|
-
# which shouldn't be used to store highly confidential information
|
7
|
-
# (create the session table with "rails generate session_migration")
|
8
|
-
# Dummy::Application.config.session_store :active_record_store
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
|
-
|
2
|
+
|
3
3
|
# This file contains settings for ActionController::ParamsWrapper which
|
4
4
|
# is enabled by default.
|
5
5
|
|
6
6
|
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
7
|
ActiveSupport.on_load(:action_controller) do
|
8
|
-
wrap_parameters format: [:json]
|
8
|
+
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
9
9
|
end
|
10
10
|
|
11
|
-
#
|
12
|
-
ActiveSupport.on_load(:active_record) do
|
13
|
-
self.include_root_in_json =
|
14
|
-
end
|
11
|
+
# To enable root element in JSON for ActiveRecord objects.
|
12
|
+
# ActiveSupport.on_load(:active_record) do
|
13
|
+
# self.include_root_in_json = true
|
14
|
+
# end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: catarse_paypal_express
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antônio Roberto Silva
|
@@ -18,28 +18,28 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: '4.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version:
|
28
|
+
version: '4.0'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: activemerchant
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - '>='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 1.
|
35
|
+
version: 1.34.0
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - '>='
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 1.
|
42
|
+
version: 1.34.0
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: slim-rails
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,16 +58,16 @@ dependencies:
|
|
58
58
|
name: rspec-rails
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- -
|
61
|
+
- - ~>
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
63
|
+
version: 2.14.0
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- -
|
68
|
+
- - ~>
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version:
|
70
|
+
version: 2.14.0
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: factory_girl_rails
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,6 +152,7 @@ files:
|
|
152
152
|
- test/dummy/config/environments/production.rb
|
153
153
|
- test/dummy/config/environments/test.rb
|
154
154
|
- test/dummy/config/initializers/backtrace_silencers.rb
|
155
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
155
156
|
- test/dummy/config/initializers/inflections.rb
|
156
157
|
- test/dummy/config/initializers/mime_types.rb
|
157
158
|
- test/dummy/config/initializers/secret_token.rb
|
@@ -166,7 +167,7 @@ files:
|
|
166
167
|
- test/dummy/public/500.html
|
167
168
|
- test/dummy/public/favicon.ico
|
168
169
|
- test/dummy/script/rails
|
169
|
-
homepage: http://github.com/
|
170
|
+
homepage: http://github.com/catarse/catarse_paypal_express
|
170
171
|
licenses: []
|
171
172
|
metadata: {}
|
172
173
|
post_install_message:
|
@@ -212,6 +213,7 @@ test_files:
|
|
212
213
|
- test/dummy/config/environments/production.rb
|
213
214
|
- test/dummy/config/environments/test.rb
|
214
215
|
- test/dummy/config/initializers/backtrace_silencers.rb
|
216
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
215
217
|
- test/dummy/config/initializers/inflections.rb
|
216
218
|
- test/dummy/config/initializers/mime_types.rb
|
217
219
|
- test/dummy/config/initializers/secret_token.rb
|