catarse_pagarme 2.6.11 → 2.6.12

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: 0d51e06a0fcaed8926df52213796b92d4efb6eeb
4
- data.tar.gz: 772d490deaf7f5c14ef8ac86c18ceb511415b274
3
+ metadata.gz: 6b8b4145eb190e806a130b688731201004c7c1ba
4
+ data.tar.gz: f98eb985ecdde23602180d5f4ddbea91f16e5ef9
5
5
  SHA512:
6
- metadata.gz: b9b568de8bebbc9b532a4be1ddc0bddd53a32a598fc7fb04e67df76af30eb6767d73b341533e668619b671242e793adb18a8e9c3c4ead493adbd99333fc0f6b8
7
- data.tar.gz: d3d62fa425cd4e740e10793c12962734e2a412dc32b96dc3ea7f4e0ecc6d8a890b15489209552cda8119e64ea26dbd14c5e05eea8255bce770ee70ce57b9d315
6
+ metadata.gz: c45303222582dda5a00f965619629610317d545aeb2a4213361def824701813c2465450d35fd00364119792f415fa794bbe1d31df8a727187ecf6f7386da91c2
7
+ data.tar.gz: a94b9062e5f740af2f6e469cfc7650d5e2c2f4a8ae1d513dcc5ce4ed77898ab80571fcae18c1c4dd48f021d5219f9620407a480c006e4b55d99d87b039d90514
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- catarse_pagarme (2.6.11)
4
+ catarse_pagarme (2.6.12)
5
5
  pagarme (= 1.10.0)
6
6
  rails (~> 4.0)
7
7
  weekdays (>= 1.0.2)
@@ -11,11 +11,9 @@ module CatarsePagarme
11
11
  def change_status_by_transaction(transactin_status)
12
12
  case transactin_status
13
13
  when 'paid', 'authorized' then
14
- if payment.refunded? || payment.pending_refund?
15
- payment.invalid_refund
16
- elsif !self.payment.paid?
17
- self.payment.pay
18
- end
14
+ self.payment.pay unless self.payment.paid?
15
+ when 'pending_refund' then
16
+ self.payment.request_refund unless self.payment.pending_refund?
19
17
  when 'refunded' then
20
18
  self.payment.refund unless self.payment.refunded?
21
19
  when 'refused' then
@@ -1,3 +1,3 @@
1
1
  module CatarsePagarme
2
- VERSION = "2.6.11"
2
+ VERSION = "2.6.12"
3
3
  end
@@ -102,7 +102,15 @@ describe CatarsePagarme::PaymentDelegator do
102
102
 
103
103
  describe "#transfer_funds" do
104
104
  let(:admin_user) { create(:user, admin: true) }
105
+ let(:transfer_mock) {
106
+ t = mock()
107
+ allow(t).to receive(:create).and_return(true)
108
+ allow(t).to receive(:id).and_return("123")
109
+ allow(t).to receive(:to_json).and_return({id: '123'}.to_json)
110
+ t
111
+ }
105
112
  before do
113
+ allow(PagarMe::Transfer).to receive(:new).and_return(transfer_mock)
106
114
  create(:bank_account, user: payment.user)
107
115
  allow(payment.user).to receive(:admin?).and_return(true)
108
116
  end
@@ -127,7 +135,6 @@ describe CatarsePagarme::PaymentDelegator do
127
135
  payment.stub(:paid?).and_return(false)
128
136
  payment.stub(:refunded?).and_return(true)
129
137
  payment.stub(:pending_refund?).and_return(false)
130
- payment.should_receive(:invalid_refund)
131
138
  end
132
139
 
133
140
  it { delegator.change_status_by_transaction(status) }
@@ -138,7 +145,6 @@ describe CatarsePagarme::PaymentDelegator do
138
145
  payment.stub(:paid?).and_return(false)
139
146
  payment.stub(:refunded?).and_return(false)
140
147
  payment.stub(:pending_refund?).and_return(true)
141
- payment.should_receive(:invalid_refund)
142
148
  end
143
149
 
144
150
  it { delegator.change_status_by_transaction(status) }
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.6.11
4
+ version: 2.6.12
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: 2015-06-22 00:00:00.000000000 Z
12
+ date: 2015-06-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails