catarse_pagarme 2.14.11 → 2.14.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
  SHA256:
3
- metadata.gz: 841d304987ba35363555c773e7d88bfe799ce92c456a7e56bb12703f61a05c11
4
- data.tar.gz: c6dfa83886c55e65d4ae3ac720b4afd447654736e8c899306fd5e5f9a0126250
3
+ metadata.gz: c52bfe0429ba2976126325031d6c5372a549e0e054e7b210d0771be827f6322a
4
+ data.tar.gz: 72f750266694d8661a6b807c9331f0ac1263679c743b0bb01b99ca9bbebf453b
5
5
  SHA512:
6
- metadata.gz: e253b3633d7da19d9c3700028b69b8791c7f294b67bce110b57c3a902f82f0b35effa888146841fdc992f562a6e96e34fec5ae713b89e587a9fdb870731238f5
7
- data.tar.gz: 704b88015accaeb1be02349e90c2ac0227e5964732d6dcca4787eb1daa95880c442ce9dd4e7a4dedc038818c2a6ffa244e6535e97bd97227ead58c6b6e6696eb
6
+ metadata.gz: 914fcfc46b1cb2a8a78ca6875552d6ef8de296449ef36033a0312661ec3dabf60028d20e42d75dc2112d3149964e368afa26f0e2b62be2a1cb56b961a689c3f7
7
+ data.tar.gz: 979286b6207d4af8d9cf93a4ee14099bc79a03361e02f8bf1825387e97c28d9a6380d7a0f0ead484b649f7676f5a147c6f36f9b714f319805bab483f0249a373
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- catarse_pagarme (2.14.11)
4
+ catarse_pagarme (2.14.12)
5
5
  countries (= 3.0.0)
6
6
  konduto-ruby (= 2.1.0)
7
7
  pagarme (= 2.1.4)
@@ -17,6 +17,8 @@ module CatarsePagarme
17
17
  render json: { payment_status: 'failed', message: e.message }
18
18
  rescue => e
19
19
  raven_capture(e)
20
+
21
+ render json: { payment_status: 'failed', message: e.message }
20
22
  end
21
23
 
22
24
  def get_installment_json
@@ -12,6 +12,8 @@ module CatarsePagarme
12
12
  self.transaction.capture
13
13
  elsif antifraud_outcome.recommendation == :DECLINE
14
14
  self.transaction.refund
15
+ elsif antifraud_outcome.recommendation == :REVIEW
16
+ self.payment.try(:notify_about_pending_review)
15
17
  end
16
18
  end
17
19
  end
@@ -1,3 +1,3 @@
1
1
  module CatarsePagarme
2
- VERSION = "2.14.11"
2
+ VERSION = "2.14.12"
3
3
  end
@@ -76,7 +76,7 @@ describe CatarsePagarme::CreditCardTransaction do
76
76
  end
77
77
  end
78
78
 
79
- context 'when antifraude recommends decline transaction' do
79
+ context 'when antifraud recommends decline transaction' do
80
80
  let(:antifraud_outcome) { double(recommendation: :DECLINE) }
81
81
 
82
82
  it 'refunds transaction' do
@@ -85,6 +85,16 @@ describe CatarsePagarme::CreditCardTransaction do
85
85
  card_transaction.process!
86
86
  end
87
87
  end
88
+
89
+ context 'when antifraud recommends review transaction' do
90
+ let(:antifraud_outcome) { double(recommendation: :REVIEW) }
91
+
92
+ it 'notifies about pending review' do
93
+ expect(card_transaction.payment).to receive(:notify_about_pending_review)
94
+
95
+ card_transaction.process!
96
+ end
97
+ end
88
98
  end
89
99
  end
90
100
 
@@ -269,7 +279,7 @@ describe CatarsePagarme::CreditCardTransaction do
269
279
  let(:antifraud_wrapper) { double }
270
280
 
271
281
  context 'when @antifraud_wrapper isn`t nil' do
272
- it 'returns @antifraude_wrapper' do
282
+ it 'returns @antifraud_wrapper' do
273
283
  card_transaction.instance_variable_set('@antifraud_wrapper', antifraud_wrapper)
274
284
  expect(card_transaction.antifraud_wrapper).to eq antifraud_wrapper
275
285
  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.14.11
4
+ version: 2.14.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: 2020-03-31 00:00:00.000000000 Z
12
+ date: 2020-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: countries