catarse_pagarme 0.1.8 → 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: bfbc03d12b7fd76bc65de6e4c6fa478855b94864
4
- data.tar.gz: 7f652c84f6f337b88ade65c6b6b1e06a573e00fb
3
+ metadata.gz: eb48d877b2a72cf8641200bc88707516c0eb0559
4
+ data.tar.gz: aad8d99b7dc3f484dfcc46bcd09995d7588965e6
5
5
  SHA512:
6
- metadata.gz: 66e8cbe1a471c226ad4d7850cd095a8776823a8991f63cd25c91789e6972d72fc8bd683f0a81f607bb159b2dbebd43daaca42f5d28c22914aa88bf936f77412e
7
- data.tar.gz: c8890e3d86bc6bb8ea3a1ac6240d25c61afd9e0e9b0c12499cc499d9d9dd26bb777c67e8459b75b6229465c959073a0839b7f91c703e5dfb96cc07b0ad0f1e64
6
+ metadata.gz: 8a7c9ce6df4c64b808a6fb8e45e81b8933c48ce031318d56be3ee75fc38634f30663924d461ea138d3ededf3383270e066076d75bf2395d1358097ace22e32e4
7
+ data.tar.gz: 38a3d044fe689901e2b68c241a043fd1cb18449e58a972610a4584fdd59142c1ef6a5b5e43585c440b5942442feeb8b98e57ee5db76a7bced8b1b254a88b613a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- catarse_pagarme (0.1.7)
4
+ catarse_pagarme (0.1.1)
5
5
  pagarme (~> 1.9.5)
6
6
  rails (~> 4.0)
7
7
 
@@ -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, host: CatarsePagarme.configuration.host,
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,
@@ -15,5 +15,13 @@ module CatarsePagarme
15
15
 
16
16
  render nothing: true, status: 404
17
17
  end
18
+
19
+ protected
20
+
21
+ def contribution
22
+ conditions = {payment_id: params[:id] }
23
+
24
+ @contribution ||= PaymentEngines.find_payment(conditions)
25
+ end
18
26
  end
19
27
  end
@@ -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, host: CatarsePagarme.configuration.host,
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(:boleto_expiration_date, :payment_method, :amount, :postback_url, customer: [:name, :email],
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, :host, :subdomain, :protocol,
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
@@ -1,3 +1,3 @@
1
1
  module CatarsePagarme
2
- VERSION = "0.1.8"
2
+ VERSION = "0.2.0"
3
3
  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.1.8
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-10-01 00:00:00.000000000 Z
12
+ date: 2014-09-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails