catarse_moip 2.3.4 → 2.3.5

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: 967268691ff2c692f1d848acab880f5de7eeb3d6
4
- data.tar.gz: 9f4f592a6c84ebb7876e6fb63a27e5a264b8af1b
3
+ metadata.gz: 344c36a8fed0b4c53949562fee1feabd419cea52
4
+ data.tar.gz: 833ac6e545acf8db63daf96af3a25c4c398bf26c
5
5
  SHA512:
6
- metadata.gz: 13ff965abd7d0406e32c44cba03b85cb2dd7286a0c358194eacbd08ac9b98f6d4de06c8e08da93c7fa4b2b622a641eca6b15c6e8b8b10b1ef4c56de224baad4a
7
- data.tar.gz: bf15b245833afd9e5c98831a1a28fa65bf8020c61680b7e75a5b91bcbec5c520440505544610948a1c5484611d9b2d1b517d120c492120dd8caf8e2dc8d726ce
6
+ metadata.gz: ef56b20b4ecd2be6a39d2fde01d2ab9d44a2e7d72eb439ee5e92257cda0bc42bfcb3b44e81c0e7fc937e157a9284a4f59c5efd034645544068f7b2f66848ab39
7
+ data.tar.gz: c7e8db509efcb22edefb45b7bfd5574df75fc2ba6940d7488c86f67bb44abfcefe4c1a6dbe34379376d46b481ac8da845b7b1eca68cc467faac5087a399408a0
@@ -130,6 +130,10 @@ module CatarseMoip
130
130
  if payment_id <= params[:cod_moip].to_i
131
131
  contribution.update_attributes payment_id: params[:cod_moip]
132
132
 
133
+ if (params[:valor].to_i/100.0) < contribution.value && params[:valor]
134
+ return contribution.invalid! unless contribution.invalid_payment?
135
+ end
136
+
133
137
  case params[:status_pagamento].to_i
134
138
  when TransactionStatus::PROCESS
135
139
  payment_notification.deliver_process_notification
@@ -1,3 +1,3 @@
1
1
  module CatarseMoip
2
- VERSION = "2.3.4"
2
+ VERSION = "2.3.5"
3
3
  end
@@ -29,7 +29,9 @@ describe CatarseMoip::MoipController do
29
29
  cancel!: true,
30
30
  refunded?: true,
31
31
  refund!: true,
32
- payment_method: 'MoIP'
32
+ payment_method: 'MoIP',
33
+ invalid!: true,
34
+ invlid_payment?: true
33
35
  }) }
34
36
 
35
37
  let(:user){ double('user', id: 1) }
@@ -306,6 +308,15 @@ describe CatarseMoip::MoipController do
306
308
  controller.stub(:update_contribution)
307
309
  end
308
310
 
311
+ context "when the value is less that contribution value" do
312
+ before do
313
+ controller.stub(:params).and_return(post_moip_params.merge!({:id_transacao => contribution.key, :valor => 9000, :status_pagamento => CatarseMoip::MoipController::TransactionStatus::AUTHORIZED}))
314
+ contribution.stub(:invalid_payment?).and_return(false)
315
+ contribution.should_receive(:invalid!)
316
+ contribution.should_receive(:update_attributes)
317
+ end
318
+ end
319
+
309
320
  context "when there is a written back request and contribution is not refunded" do
310
321
  before do
311
322
  controller.stub(:params).and_return(post_moip_params.merge!({:id_transacao => contribution.key, :status_pagamento => CatarseMoip::MoipController::TransactionStatus::WRITTEN_BACK}))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: catarse_moip
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.4
4
+ version: 2.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antônio Roberto Silva
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-03-18 00:00:00.000000000 Z
13
+ date: 2014-04-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails