catarse_pagarme 2.10.9 → 2.10.10

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: 96e7208028e6f47896c44f2b930145d6609aadf3
4
- data.tar.gz: cac24e705e30a7a5066ff226a872bb02c474aa7a
3
+ metadata.gz: 4f1e3a365192c4dc5d2db50ee85d4203c39c46a7
4
+ data.tar.gz: d08d60e4e26b8d3459cd43516aaf3872f092e09b
5
5
  SHA512:
6
- metadata.gz: 4ab2d0f8be49f39f5d999eaa22c3ce105c80934aa8b7e2428436ff2c28cf7665a37f4069623aae3daad2103c78caacfac9c81677c566b43ce52e641a4b73f3b4
7
- data.tar.gz: 36533053bc88948a9cce18f8a1256d5c3573273cfbd0347ea9e4ebb8b986d4bca1aa72f57e8e381746659d194a9c1e93cf48b08cd4ccd538dedf174e02433b13
6
+ metadata.gz: 4f9c38e66e2679a065f1a6e405ba9f53b8163c11f22061e615fd31056beacfb40cd0b80c67c58dd2ca786b7444ae6eff6082595ab7d3fa11bc93f7311677922b
7
+ data.tar.gz: 1148fad1da62d736bdf3e0e03c939ffa4c3d0c83366e04121b07aab082430045a11086883469717f221ed9c7b4290890592487ad460d5f11517f5e0746df26bd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- catarse_pagarme (2.10.9)
4
+ catarse_pagarme (2.10.10)
5
5
  pagarme (= 2.1.4)
6
6
  rails (~> 4.0)
7
7
  sentry-raven
@@ -123,7 +123,7 @@ GEM
123
123
  thor (>= 0.18.1, < 2.0)
124
124
  rake (10.4.2)
125
125
  redis (3.3.2)
126
- rest-client (2.0.1)
126
+ rest-client (2.0.2)
127
127
  http-cookie (>= 1.0.2, < 2.0)
128
128
  mime-types (>= 1.16, < 4.0)
129
129
  netrc (~> 0.8)
@@ -13,6 +13,7 @@ module CatarsePagarme
13
13
  end
14
14
 
15
15
  def update
16
+ payment.generating_second_slip = true
16
17
  transaction = SlipTransaction.new(slip_attributes, payment).charge!
17
18
  respond_to do |format|
18
19
  format.html { redirect_to transaction.boleto_url }
@@ -1,6 +1,14 @@
1
1
  module CatarsePagarme
2
2
  class SlipTransaction < TransactionBase
3
3
  def charge!
4
+ unless payment.update_attributes({
5
+ gateway: 'Pagarme',
6
+ payment_method: payment_method})
7
+
8
+ raise ::PagarMe::PagarMeError.new(
9
+ payment.errors.messages.values.flatten.to_sentence)
10
+ end
11
+
4
12
  self.transaction = PagarMe::Transaction.new(self.attributes)
5
13
  self.transaction.charge
6
14
 
@@ -1,3 +1,3 @@
1
1
  module CatarsePagarme
2
- VERSION = "2.10.9"
2
+ VERSION = "2.10.10"
3
3
  end
@@ -7,6 +7,8 @@ class Payment < ActiveRecord::Base
7
7
  validates_presence_of :state, :key, :gateway, :payment_method, :value, :installments
8
8
  validate :value_should_be_equal_or_greater_than_pledge
9
9
 
10
+ attr_accessor :generating_second_slip
11
+
10
12
  before_validation do
11
13
  generate_key
12
14
  self.value ||= self.contribution.try(:value)
@@ -35,7 +35,7 @@ describe FakeBankAccount do
35
35
  end
36
36
 
37
37
  it "bank_account_on_pagarme should be not valid with these attrs" do
38
- expect(bank_account_on_pagarme.valid?).to be_falsy
38
+ expect(bank_account_on_pagarme.valid?).to be_falsey
39
39
  end
40
40
 
41
41
  it "bank_account_on_pagarme should be valid with another attrs" do
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.9
4
+ version: 2.10.10
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-05-06 00:00:00.000000000 Z
12
+ date: 2017-05-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails