catarse_pagarme 2.10.8 → 2.10.9

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: 7c811dfbe9f3f8b912048b3c33fbc5e0a3372174
4
- data.tar.gz: dc789ff87cdeecad5eb52b2c3f19f17dda2cc4b1
3
+ metadata.gz: 96e7208028e6f47896c44f2b930145d6609aadf3
4
+ data.tar.gz: cac24e705e30a7a5066ff226a872bb02c474aa7a
5
5
  SHA512:
6
- metadata.gz: 667ffd94cfb3d637d2be55460b76e397b76e68afa4448b61b4f2e3f88b747387fc98f08ba25c5e10b49abaa355a25e8a28dfd3579b91180ebfb8ef2b005a3edd
7
- data.tar.gz: 82aa1145e9c2e2864ec4fa09d19751353d4322eab668f4c4312ec884d18c50463fa94b179e029ea399119b33fa7cda872225e707d84200d0560ce87c5d616377
6
+ metadata.gz: 4ab2d0f8be49f39f5d999eaa22c3ce105c80934aa8b7e2428436ff2c28cf7665a37f4069623aae3daad2103c78caacfac9c81677c566b43ce52e641a4b73f3b4
7
+ data.tar.gz: 36533053bc88948a9cce18f8a1256d5c3573273cfbd0347ea9e4ebb8b986d4bca1aa72f57e8e381746659d194a9c1e93cf48b08cd4ccd538dedf174e02433b13
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- catarse_pagarme (2.10.8)
4
+ catarse_pagarme (2.10.9)
5
5
  pagarme (= 2.1.4)
6
6
  rails (~> 4.0)
7
7
  sentry-raven
@@ -53,7 +53,7 @@ GEM
53
53
  connection_pool (2.2.1)
54
54
  database_cleaner (1.5.0)
55
55
  diff-lcs (1.2.5)
56
- domain_name (0.5.20170223)
56
+ domain_name (0.5.20170404)
57
57
  unf (>= 0.0.5, < 1.0.0)
58
58
  erubis (2.7.0)
59
59
  factory_girl (4.5.0)
@@ -165,7 +165,7 @@ GEM
165
165
  thread_safe (~> 0.1)
166
166
  unf (0.1.4)
167
167
  unf_ext
168
- unf_ext (0.0.7.2)
168
+ unf_ext (0.0.7.4)
169
169
  weekdays (1.0.2)
170
170
 
171
171
  PLATFORMS
@@ -7,7 +7,7 @@ module CatarsePagarme
7
7
  transaction = CreditCardTransaction.new(credit_card_attributes, payment).charge!
8
8
 
9
9
  render json: { payment_status: transaction.status }
10
- rescue PagarMe::PagarMeError => e
10
+ rescue PagarMe::PagarMeError, PagarMe::ValidationError => e
11
11
  # should ignore refused payments
12
12
  if payment.state != 'refused'
13
13
  raven_capture(e)
@@ -28,6 +28,7 @@ module CatarsePagarme
28
28
  protected
29
29
 
30
30
  def credit_card_attributes
31
+ contribution.reload
31
32
  hash = {
32
33
  payment_method: 'credit_card',
33
34
  amount: delegator.value_with_installment_tax(get_installment),
@@ -6,11 +6,13 @@ module CatarsePagarme
6
6
 
7
7
  self.transaction = PagarMe::Transaction.new(self.attributes)
8
8
 
9
- payment.update_attributes({
9
+ unless payment.update_attributes({
10
10
  gateway: 'Pagarme',
11
- payment_method: payment_method
12
- })
13
- payment.save!
11
+ payment_method: payment_method })
12
+
13
+ raise ::PagarMe::PagarMeError.new(
14
+ payment.errors.messages.values.flatten.to_sentence)
15
+ end
14
16
 
15
17
  self.transaction.charge
16
18
 
@@ -1,3 +1,3 @@
1
1
  module CatarsePagarme
2
- VERSION = "2.10.8"
2
+ VERSION = "2.10.9"
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: 2.10.8
4
+ version: 2.10.9
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: 2017-04-19 00:00:00.000000000 Z
12
+ date: 2017-05-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails