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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b8b4145eb190e806a130b688731201004c7c1ba
|
4
|
+
data.tar.gz: f98eb985ecdde23602180d5f4ddbea91f16e5ef9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c45303222582dda5a00f965619629610317d545aeb2a4213361def824701813c2465450d35fd00364119792f415fa794bbe1d31df8a727187ecf6f7386da91c2
|
7
|
+
data.tar.gz: a94b9062e5f740af2f6e469cfc7650d5e2c2f4a8ae1d513dcc5ce4ed77898ab80571fcae18c1c4dd48f021d5219f9620407a480c006e4b55d99d87b039d90514
|
data/Gemfile.lock
CHANGED
@@ -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
|
-
|
15
|
-
|
16
|
-
|
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
|
@@ -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.
|
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-
|
12
|
+
date: 2015-06-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|