catarse_moip 2.0.5 → 2.0.6
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: 2ad30944159275b878e971237fc566e0aba174c8
|
4
|
+
data.tar.gz: f1ae8a710a0447a6d16c015e1e5fafbddc31cef0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11f5efd0e2254b6aec8bfa43872187e5b74b5de51d3032d27771b7a4bb50cfef5cd33b5505e2e614cf1c94baa39c620dca5b02afb5db349c123c3cdd0f0d53ca
|
7
|
+
data.tar.gz: 95413aef885d34bfc03c18371cece705f8b7368d7812b0af37f59759a3569c2fb1f8e6ed669a4ad4ec884ca2c0da522f4cf31c1cc46d614667f06f59a06db4a7
|
data/Gemfile.lock
CHANGED
@@ -119,7 +119,9 @@ module CatarseMoip
|
|
119
119
|
PaymentEngines.create_payment_notification backer_id: backer.id, extra_data: JSON.parse(params.to_json.force_encoding('iso-8859-1').encode('utf-8'))
|
120
120
|
|
121
121
|
backer.with_lock do
|
122
|
-
|
122
|
+
payment_id = (backer.payment_id.gsub(".", "").to_i rescue 0)
|
123
|
+
|
124
|
+
if payment_id <= params[:cod_moip].to_i
|
123
125
|
backer.update_attributes payment_id: params[:cod_moip]
|
124
126
|
|
125
127
|
case params[:status_pagamento].to_i
|
data/lib/catarse_moip/version.rb
CHANGED
@@ -114,6 +114,21 @@ describe CatarseMoip::MoipController do
|
|
114
114
|
its(:status){ should == 200 }
|
115
115
|
it("should assign backer"){ assigns(:backer).should == backer }
|
116
116
|
end
|
117
|
+
|
118
|
+
context "when backer payment_id is null" do
|
119
|
+
before do
|
120
|
+
controller.stub(:params).and_return({:cod_moip => 122, :id_transacao =>backer.key, :controller => "catarse_moip/moip", :action => "create_notification", :status_pagamento => 5})
|
121
|
+
backer.stub(:payment_id).and_return(nil)
|
122
|
+
|
123
|
+
controller.should_receive(:process_moip_message).and_call_original
|
124
|
+
backer.should_receive(:update_attributes).with(payment_id: 122)
|
125
|
+
post :create_notification, {:id_transacao => backer.key, :use_route => 'catarse_moip'}
|
126
|
+
end
|
127
|
+
|
128
|
+
its(:body){ should == ' ' }
|
129
|
+
its(:status){ should == 200 }
|
130
|
+
it("should assign backer"){ assigns(:backer).should == backer }
|
131
|
+
end
|
117
132
|
end
|
118
133
|
|
119
134
|
describe "GET js" do
|
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.0.
|
4
|
+
version: 2.0.6
|
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: 2013-09-
|
13
|
+
date: 2013-09-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|