catarse_moip 2.0.8 → 2.0.9

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: 4f736e29b671b7b085607bd2bfa4c095759b1275
4
- data.tar.gz: 4a26137f385716d696a1aa646346b14061f87ec0
3
+ metadata.gz: 9bc0bb6bba8ec6324a25c0c9b7ceaf7cc348e8b7
4
+ data.tar.gz: 21a186dc54871da853a2c7d93ee794255d951e6b
5
5
  SHA512:
6
- metadata.gz: f2af8696a1bf47db44074f43ab4ea03f2de184ac98263593124ab3d84ae0034622e878aa789dbe8f8fb37426f22265e4a3baa89bf44ac2ab90cdf87f007d0530
7
- data.tar.gz: e7aeb8486d31ad396d75600c3e9bd0f9b7e0935a22a84a0a1486e40f635eebb4e35aacfda17ac50016c759349081bce2524d237f8f615da1b2730e3b9b6900df
6
+ metadata.gz: efd17472ada43000e6cf4cc8114647230dd6ea90423a6664e367bd20fdfd7ec4b0e6ce3559a682516ac01c348b48bd72b76f143aed5078d548bc008d450d2781
7
+ data.tar.gz: 3bdf7f151040de0ef46249940ba291c6e2643973a127d87a3126e416bc12c18e8dbdda88f41776ee8c67a3ccbf2cce35d9610044c49eb686248af4d5bab230b8
data/Gemfile.lock CHANGED
@@ -10,7 +10,7 @@ GIT
10
10
  PATH
11
11
  remote: .
12
12
  specs:
13
- catarse_moip (2.0.8)
13
+ catarse_moip (2.0.9)
14
14
  libxml-ruby (~> 2.6.0)
15
15
  rails (~> 4.0)
16
16
 
@@ -41,7 +41,7 @@ GEM
41
41
  multi_json (~> 1.3)
42
42
  thread_safe (~> 0.1)
43
43
  tzinfo (~> 0.3.37)
44
- arel (4.0.0)
44
+ arel (4.0.1)
45
45
  atomic (1.1.14)
46
46
  builder (3.1.4)
47
47
  crack (0.1.8)
@@ -63,7 +63,7 @@ GEM
63
63
  mail (2.5.4)
64
64
  mime-types (~> 1.16)
65
65
  treetop (~> 1.4.8)
66
- mime-types (1.25)
66
+ mime-types (1.25.1)
67
67
  minitest (4.7.5)
68
68
  multi_json (1.8.0)
69
69
  nokogiri (1.5.10)
@@ -97,12 +97,12 @@ GEM
97
97
  rspec-core (~> 2.14.0)
98
98
  rspec-expectations (~> 2.14.0)
99
99
  rspec-mocks (~> 2.14.0)
100
- sprockets (2.10.0)
100
+ sprockets (2.10.1)
101
101
  hike (~> 1.2)
102
102
  multi_json (~> 1.0)
103
103
  rack (~> 1.0)
104
104
  tilt (~> 1.1, != 1.3.0)
105
- sprockets-rails (2.0.0)
105
+ sprockets-rails (2.0.1)
106
106
  actionpack (>= 3.0)
107
107
  activesupport (>= 3.0)
108
108
  sprockets (~> 2.8)
@@ -22,7 +22,7 @@ module CatarseMoip
22
22
 
23
23
  def create_notification
24
24
  @backer = PaymentEngines.find_payment key: params[:id_transacao]
25
- process_moip_message
25
+ process_moip_message if @backer.payment_method == 'MoIP' || @backer.payment_method.nil?
26
26
  return render :nothing => true, :status => 200
27
27
  rescue Exception => e
28
28
  return render :text => "#{e.inspect}: #{e.message} recebemos: #{params}", :status => 422
@@ -113,6 +113,7 @@ module CatarseMoip
113
113
  backer.update_attributes({
114
114
  :payment_id => params["CodigoMoIP"],
115
115
  :payment_choice => params["FormaPagamento"],
116
+ :payment_method => 'MoIP',
116
117
  :payment_service_fee => params["TaxaMoIP"]
117
118
  }) if params
118
119
  end
@@ -1,3 +1,3 @@
1
1
  module CatarseMoip
2
- VERSION = "2.0.8"
2
+ VERSION = "2.0.9"
3
3
  end
@@ -28,7 +28,8 @@ describe CatarseMoip::MoipController do
28
28
  canceled?: true,
29
29
  cancel!: true,
30
30
  refunded?: true,
31
- refund!: true
31
+ refund!: true,
32
+ payment_method: 'MoIP'
32
33
  }) }
33
34
 
34
35
  let(:user){ double('user', id: 1) }
@@ -115,6 +116,20 @@ describe CatarseMoip::MoipController do
115
116
  it("should assign backer"){ assigns(:backer).should == backer }
116
117
  end
117
118
 
119
+ context "when backer payment_method is PayPal" do
120
+ before do
121
+ controller.stub(:params).and_return({:cod_moip => 125, :id_transacao =>backer.key, :controller => "catarse_moip/moip", :action => "create_notification", :status_pagamento => 5})
122
+ backer.stub(:payment_method).and_return('PayPal')
123
+
124
+ controller.should_not_receive(:process_moip_message)
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
132
+
118
133
  context "when backer payment_id is null" do
119
134
  before do
120
135
  controller.stub(:params).and_return({:cod_moip => 122, :id_transacao =>backer.key, :controller => "catarse_moip/moip", :action => "create_notification", :status_pagamento => 5})
@@ -213,6 +228,7 @@ describe CatarseMoip::MoipController do
213
228
  backer.should_receive(:update_attributes).with({
214
229
  payment_id: payment["CodigoMoIP"],
215
230
  payment_choice: payment["FormaPagamento"],
231
+ payment_method: 'MoIP',
216
232
  payment_service_fee: payment["TaxaMoIP"]
217
233
  })
218
234
  end
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.8
4
+ version: 2.0.9
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-20 00:00:00.000000000 Z
13
+ date: 2013-12-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  version: '0'
185
185
  requirements: []
186
186
  rubyforge_project:
187
- rubygems_version: 2.0.3
187
+ rubygems_version: 2.0.7
188
188
  signing_key:
189
189
  specification_version: 4
190
190
  summary: MoIP integration with Catarse