catarse_moip 2.0.7 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1488918c2987966bc5794036e16ba1549fd302e
4
- data.tar.gz: ad6f576de72bf2d8b68a36ce109e31d737652304
3
+ metadata.gz: 4f736e29b671b7b085607bd2bfa4c095759b1275
4
+ data.tar.gz: 4a26137f385716d696a1aa646346b14061f87ec0
5
5
  SHA512:
6
- metadata.gz: 537bc54fe7952efd19860cbf994204e3fe3416ade207d2fb1a5efdbcd31cae7435236ff203f357bb99ad7bf83abab3dbe2cf12a80f9c14dc34349847905061d2
7
- data.tar.gz: d7a3f3f962e5207d158019983b0eb0ecf3df4a403a2734ce68e93c3540a02e440d8e181499980d51eff2f8a145289a5e475f25793d750dddf749deef65470285
6
+ metadata.gz: f2af8696a1bf47db44074f43ab4ea03f2de184ac98263593124ab3d84ae0034622e878aa789dbe8f8fb37426f22265e4a3baa89bf44ac2ab90cdf87f007d0530
7
+ data.tar.gz: e7aeb8486d31ad396d75600c3e9bd0f9b7e0935a22a84a0a1486e40f635eebb4e35aacfda17ac50016c759349081bce2524d237f8f615da1b2730e3b9b6900df
@@ -10,7 +10,7 @@ GIT
10
10
  PATH
11
11
  remote: .
12
12
  specs:
13
- catarse_moip (2.0.7)
13
+ catarse_moip (2.0.8)
14
14
  libxml-ruby (~> 2.6.0)
15
15
  rails (~> 4.0)
16
16
 
@@ -42,12 +42,12 @@ GEM
42
42
  thread_safe (~> 0.1)
43
43
  tzinfo (~> 0.3.37)
44
44
  arel (4.0.0)
45
- atomic (1.1.13)
45
+ atomic (1.1.14)
46
46
  builder (3.1.4)
47
47
  crack (0.1.8)
48
48
  database_cleaner (1.1.1)
49
49
  diff-lcs (1.2.4)
50
- enumerate_it (1.1.1)
50
+ enumerate_it (1.2.0)
51
51
  activesupport (>= 3.0.0)
52
52
  erubis (2.7.0)
53
53
  factory_girl (4.2.0)
@@ -65,9 +65,9 @@ GEM
65
65
  treetop (~> 1.4.8)
66
66
  mime-types (1.25)
67
67
  minitest (4.7.5)
68
- multi_json (1.7.9)
68
+ multi_json (1.8.0)
69
69
  nokogiri (1.5.10)
70
- pg (0.16.0)
70
+ pg (0.17.0)
71
71
  polyglot (0.3.3)
72
72
  rack (1.5.2)
73
73
  rack-test (0.6.2)
@@ -107,7 +107,7 @@ GEM
107
107
  activesupport (>= 3.0)
108
108
  sprockets (~> 2.8)
109
109
  thor (0.18.1)
110
- thread_safe (0.1.2)
110
+ thread_safe (0.1.3)
111
111
  atomic
112
112
  tilt (1.4.1)
113
113
  treetop (1.4.15)
@@ -103,22 +103,25 @@ module CatarseMoip
103
103
  params = response["Autorizacao"]["Pagamento"]
104
104
  params = params.first unless params.respond_to?(:key)
105
105
 
106
- if params["Status"] == "Autorizado"
107
- backer.confirm!
108
- end
106
+ backer.with_lock do
107
+ if params["Status"] == "Autorizado"
108
+ backer.confirm!
109
+ elsif backer.pending?
110
+ backer.waiting!
111
+ end
109
112
 
110
- backer.update_attributes({
111
- :payment_id => params["CodigoMoIP"],
112
- :payment_choice => params["FormaPagamento"],
113
- :payment_service_fee => params["TaxaMoIP"]
114
- }) if params
113
+ backer.update_attributes({
114
+ :payment_id => params["CodigoMoIP"],
115
+ :payment_choice => params["FormaPagamento"],
116
+ :payment_service_fee => params["TaxaMoIP"]
117
+ }) if params
118
+ end
115
119
  end
116
120
  end
117
121
 
118
122
  def process_moip_message
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
-
121
123
  backer.with_lock do
124
+ PaymentEngines.create_payment_notification backer_id: backer.id, extra_data: JSON.parse(params.to_json.force_encoding('iso-8859-1').encode('utf-8'))
122
125
  payment_id = (backer.payment_id.gsub(".", "").to_i rescue 0)
123
126
 
124
127
  if payment_id <= params[:cod_moip].to_i
@@ -1,3 +1,3 @@
1
1
  module CatarseMoip
2
- VERSION = "2.0.7"
2
+ VERSION = "2.0.8"
3
3
  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.7
4
+ version: 2.0.8
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 00:00:00.000000000 Z
13
+ date: 2013-09-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails