catarse_pagarme 0.1.8 → 0.2.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 +1 -5
- data/app/controllers/catarse_pagarme/credit_card_base_controller.rb +1 -3
- data/app/controllers/catarse_pagarme/notifications_controller.rb +8 -0
- data/app/controllers/catarse_pagarme/slip_controller.rb +2 -5
- data/lib/catarse_pagarme/configuration.rb +1 -4
- 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: eb48d877b2a72cf8641200bc88707516c0eb0559
|
4
|
+
data.tar.gz: aad8d99b7dc3f484dfcc46bcd09995d7588965e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a7c9ce6df4c64b808a6fb8e45e81b8933c48ce031318d56be3ee75fc38634f30663924d461ea138d3ededf3383270e066076d75bf2395d1358097ace22e32e4
|
7
|
+
data.tar.gz: 38a3d044fe689901e2b68c241a043fd1cb18449e58a972610a4584fdd59142c1ef6a5b5e43585c440b5942442feeb8b98e57ee5db76a7bced8b1b254a88b613a
|
data/Gemfile.lock
CHANGED
@@ -35,11 +35,7 @@ module CatarsePagarme
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def contribution
|
38
|
-
conditions = {id: params[:id] }
|
39
|
-
|
40
|
-
unless params[:controller] == 'catarse_pagarme/notifications'
|
41
|
-
conditions.merge!({user_id: current_user.id})
|
42
|
-
end
|
38
|
+
conditions = {id: params[:id], user_id: current_user.id }
|
43
39
|
|
44
40
|
@contribution ||= PaymentEngines.find_payment(conditions)
|
45
41
|
end
|
@@ -36,9 +36,7 @@ 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,
|
40
|
-
subdomain: CatarsePagarme.configuration.subdomain,
|
41
|
-
protocol: CatarsePagarme.configuration.protocol),
|
39
|
+
postback_url: ipn_pagarme_url(contribution),
|
42
40
|
installments: get_installment,
|
43
41
|
customer: {
|
44
42
|
email: contribution.user.email,
|
@@ -19,11 +19,8 @@ module CatarsePagarme
|
|
19
19
|
def slip_attributes
|
20
20
|
{
|
21
21
|
payment_method: 'boleto',
|
22
|
-
boleto_expiration_date: 2.days.from_now,
|
23
22
|
amount: delegator.value_for_transaction,
|
24
|
-
postback_url: ipn_pagarme_url(contribution,
|
25
|
-
subdomain: CatarsePagarme.configuration.subdomain,
|
26
|
-
protocol: CatarsePagarme.configuration.protocol),
|
23
|
+
postback_url: ipn_pagarme_url(contribution),
|
27
24
|
customer: {
|
28
25
|
email: contribution.user.email,
|
29
26
|
name: contribution.user.name
|
@@ -33,7 +30,7 @@ module CatarsePagarme
|
|
33
30
|
|
34
31
|
def permitted_attributes
|
35
32
|
attrs = ActionController::Parameters.new(slip_attributes)
|
36
|
-
attrs.permit(:
|
33
|
+
attrs.permit(:payment_method, :amount, :postback_url, customer: [:name, :email],
|
37
34
|
user: [
|
38
35
|
bank_account_attributes: [
|
39
36
|
:bank_id, :account, :account_digit, :agency,
|
@@ -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,
|
4
4
|
:max_installments, :minimum_value_for_installment, :credit_card_cents_fee
|
5
5
|
|
6
6
|
def initialize
|
@@ -11,9 +11,6 @@ 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'
|
17
14
|
end
|
18
15
|
end
|
19
16
|
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: 0.2.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-09-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|