catarse_pagarme 0.2.0 → 1.0.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 +4 -4
- data/Gemfile.lock +1 -1
- data/app/controllers/catarse_pagarme/application_controller.rb +5 -1
- data/app/controllers/catarse_pagarme/credit_card_base_controller.rb +3 -1
- data/app/controllers/catarse_pagarme/notifications_controller.rb +0 -8
- data/app/controllers/catarse_pagarme/slip_controller.rb +5 -2
- data/app/views/catarse_pagarme/pagarme/review.html.slim +1 -1
- data/lib/catarse_pagarme/configuration.rb +4 -1
- data/lib/catarse_pagarme/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f3607d5f370d43423f628e8a465e6a3ce7577ce3
|
|
4
|
+
data.tar.gz: abc10f4ade038574d8aee9974d46ea3960090be3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0860d30723f258e869fe2e94ca50cedd430803d273d3ca1b104ce3fbfd5b7af912928886ae9dd59b250909b7d4cca028b2eba9da4e1578836a87fbefcc2a5ff7
|
|
7
|
+
data.tar.gz: 55273872c9fd0461a4f66388a6ce1c10779fd9545267b5fd646813bf4f3f79b53711d001c3298a8af827d059ffcf82ab98a55ee94cda2631bb44b786e3addd7b
|
data/Gemfile.lock
CHANGED
|
@@ -35,7 +35,11 @@ module CatarsePagarme
|
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def contribution
|
|
38
|
-
conditions = {id: params[:id]
|
|
38
|
+
conditions = {id: params[:id] }
|
|
39
|
+
|
|
40
|
+
unless params[:controller] == 'catarse_pagarme/notifications'
|
|
41
|
+
conditions.merge!({user_id: current_user.id}) unless current_user.admin
|
|
42
|
+
end
|
|
39
43
|
|
|
40
44
|
@contribution ||= PaymentEngines.find_payment(conditions)
|
|
41
45
|
end
|
|
@@ -36,7 +36,9 @@ module CatarsePagarme
|
|
|
36
36
|
card_expiration_year: splited_month_and_year[1],
|
|
37
37
|
card_cvv: params[:payment_card_source],
|
|
38
38
|
amount: delegator.value_with_installment_tax(get_installment),
|
|
39
|
-
postback_url: ipn_pagarme_url(contribution
|
|
39
|
+
postback_url: ipn_pagarme_url(contribution, host: CatarsePagarme.configuration.host,
|
|
40
|
+
subdomain: CatarsePagarme.configuration.subdomain,
|
|
41
|
+
protocol: CatarsePagarme.configuration.protocol),
|
|
40
42
|
installments: get_installment,
|
|
41
43
|
customer: {
|
|
42
44
|
email: contribution.user.email,
|
|
@@ -19,8 +19,11 @@ module CatarsePagarme
|
|
|
19
19
|
def slip_attributes
|
|
20
20
|
{
|
|
21
21
|
payment_method: 'boleto',
|
|
22
|
+
boleto_expiration_date: 2.days.from_now,
|
|
22
23
|
amount: delegator.value_for_transaction,
|
|
23
|
-
postback_url: ipn_pagarme_url(contribution
|
|
24
|
+
postback_url: ipn_pagarme_url(contribution, host: CatarsePagarme.configuration.host,
|
|
25
|
+
subdomain: CatarsePagarme.configuration.subdomain,
|
|
26
|
+
protocol: CatarsePagarme.configuration.protocol),
|
|
24
27
|
customer: {
|
|
25
28
|
email: contribution.user.email,
|
|
26
29
|
name: contribution.user.name
|
|
@@ -30,7 +33,7 @@ module CatarsePagarme
|
|
|
30
33
|
|
|
31
34
|
def permitted_attributes
|
|
32
35
|
attrs = ActionController::Parameters.new(slip_attributes)
|
|
33
|
-
attrs.permit(:payment_method, :amount, :postback_url, customer: [:name, :email],
|
|
36
|
+
attrs.permit(:boleto_expiration_date, :payment_method, :amount, :postback_url, customer: [:name, :email],
|
|
34
37
|
user: [
|
|
35
38
|
bank_account_attributes: [
|
|
36
39
|
:bank_id, :account, :account_digit, :agency,
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
= simple_form_for current_user, url: 'javascript:void(0)' do |f|
|
|
98
98
|
.bank_accounts
|
|
99
99
|
= f.simple_fields_for :bank_account do |bank_form|
|
|
100
|
-
= bank_form.input :bank_id, as: :select, collection: Bank.
|
|
100
|
+
= bank_form.input :bank_id, as: :select, collection: Bank.to_collection, input_html: { style: 'width: 150px' }
|
|
101
101
|
= bank_form.input :agency, as: :string
|
|
102
102
|
= bank_form.input :agency_digit, as: :string
|
|
103
103
|
= bank_form.input :account, as: :string
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module CatarsePagarme
|
|
2
2
|
class Configuration
|
|
3
|
-
attr_accessor :api_key, :slip_tax, :credit_card_tax, :interest_rate,
|
|
3
|
+
attr_accessor :api_key, :slip_tax, :credit_card_tax, :interest_rate, :host, :subdomain, :protocol,
|
|
4
4
|
:max_installments, :minimum_value_for_installment, :credit_card_cents_fee
|
|
5
5
|
|
|
6
6
|
def initialize
|
|
@@ -11,6 +11,9 @@ module CatarsePagarme
|
|
|
11
11
|
self.max_installments = 12
|
|
12
12
|
self.minimum_value_for_installment = 10
|
|
13
13
|
self.credit_card_cents_fee = 0.39
|
|
14
|
+
self.host = 'catarse.me'
|
|
15
|
+
self.subdomain = 'www'
|
|
16
|
+
self.protocol = 'http'
|
|
14
17
|
end
|
|
15
18
|
end
|
|
16
19
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: catarse_pagarme
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Antônio Roberto Silva
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2014-
|
|
12
|
+
date: 2014-10-01 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|