smartkiosk-client 0.0.21 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,15 @@ class Application
7
7
 
8
8
  post '/payments/:id/open_cash_acceptor' do
9
9
  payment = Payment.find(params[:id])
10
- Smartware.cash_acceptor.open(payment.limit.try('[]', :min), payment.limit.try('[]', :max))
10
+ min = nil
11
+ max = nil
12
+
13
+ if payment.limit.include? :min
14
+ min = payment.limit[:min].to_i
15
+ max = payment.limit[:max].to_i
16
+ end
17
+
18
+ Smartware.cash_acceptor.open min, max
11
19
 
12
20
  json Smartware.cash_acceptor.error.blank?
13
21
  end
@@ -10,7 +10,7 @@ class Payment < ActiveRecord::Base
10
10
  scope :cashless, where(arel_table[:payment_type].not_eq 0)
11
11
 
12
12
  serialize :fields
13
- serialize :limits
13
+ serialize :limit
14
14
  serialize :commissions
15
15
  serialize :banknotes
16
16
 
@@ -30,7 +30,7 @@ class Payment < ActiveRecord::Base
30
30
  after_save do
31
31
  if checked?
32
32
  r = Receipt.find_or_create_by_document_id_and_document_type(id, self.class.name)
33
- r.update_attributes :template => self.receipt_template,
33
+ r.update_attributes :template => self.receipt_template,
34
34
  :keyword => 'payment',
35
35
  :fields => {
36
36
  :recipient => title,
@@ -15,6 +15,8 @@ module Sync
15
15
  templates = JSON.parse(response.to_s, :symbolize_names => true)
16
16
 
17
17
  templates.each do |entry|
18
+ Sidekiq::Logging.logger.info "Got #{entry[:keyword]} receipt template"
19
+
18
20
  ReceiptTemplate.find_or_create_by_keyword(entry[:keyword]).
19
21
  update_attributes :template => entry[:template]
20
22
  end
data/lib/pinger.rb CHANGED
@@ -3,7 +3,7 @@ class Pinger
3
3
  result = true
4
4
 
5
5
  begin
6
- RestClient.get uri
6
+ RestClient::Resource.new(uri, :timeout => 5, :open_timeout => 5).get
7
7
  rescue RestClient::Forbidden
8
8
  rescue Exception => e
9
9
  result = e.to_s
@@ -2,6 +2,6 @@ require 'sinatra/base'
2
2
 
3
3
  module Smartkiosk
4
4
  class Client < Sinatra::Base
5
- VERSION = '0.0.21'
5
+ VERSION = '0.0.22'
6
6
  end
7
7
  end
@@ -13,7 +13,7 @@ task :schedule do
13
13
  Terminal.ping
14
14
  end
15
15
 
16
- scheduler.every '3h' do
16
+ scheduler.every '3h', :first_in => '1s' do
17
17
  logger.debug "Receipt Templates sync"
18
18
  Sync::ReceiptTemplatesWorker.perform_async
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartkiosk-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2013-02-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
17
- requirement: &70135708431800 !ruby/object:Gem::Requirement
17
+ requirement: &70268526276460 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - =
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 10.0.3
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70135708431800
25
+ version_requirements: *70268526276460
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: thin
28
- requirement: &70135708430840 !ruby/object:Gem::Requirement
28
+ requirement: &70268526290640 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - =
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 1.5.0
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70135708430840
36
+ version_requirements: *70268526290640
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: sinatra
39
- requirement: &70135708451140 !ruby/object:Gem::Requirement
39
+ requirement: &70268526289720 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - =
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 1.3.4
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *70135708451140
47
+ version_requirements: *70268526289720
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: sinatra-activerecord
50
- requirement: &70135708449180 !ruby/object:Gem::Requirement
50
+ requirement: &70268526288340 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - =
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: 1.2.1
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *70135708449180
58
+ version_requirements: *70268526288340
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: sinatra-contrib
61
- requirement: &70135708447300 !ruby/object:Gem::Requirement
61
+ requirement: &70268526287160 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - =
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: 1.3.2
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *70135708447300
69
+ version_requirements: *70268526287160
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: haml
72
- requirement: &70135708444320 !ruby/object:Gem::Requirement
72
+ requirement: &70268526284900 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - =
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: 3.1.7
78
78
  type: :runtime
79
79
  prerelease: false
80
- version_requirements: *70135708444320
80
+ version_requirements: *70268526284900
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: sass
83
- requirement: &70135708466040 !ruby/object:Gem::Requirement
83
+ requirement: &70268526308560 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - =
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: 3.2.5
89
89
  type: :runtime
90
90
  prerelease: false
91
- version_requirements: *70135708466040
91
+ version_requirements: *70268526308560
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: sprockets
94
- requirement: &70135708464820 !ruby/object:Gem::Requirement
94
+ requirement: &70268526305460 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - =
@@ -99,10 +99,10 @@ dependencies:
99
99
  version: 2.8.2
100
100
  type: :runtime
101
101
  prerelease: false
102
- version_requirements: *70135708464820
102
+ version_requirements: *70268526305460
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: sprockets-sass
105
- requirement: &70135708463260 !ruby/object:Gem::Requirement
105
+ requirement: &70268526304880 !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
108
108
  - - =
@@ -110,10 +110,10 @@ dependencies:
110
110
  version: 0.9.1
111
111
  type: :runtime
112
112
  prerelease: false
113
- version_requirements: *70135708463260
113
+ version_requirements: *70268526304880
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: sprockets-helpers
116
- requirement: &70135708461860 !ruby/object:Gem::Requirement
116
+ requirement: &70268526304060 !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements:
119
119
  - - =
@@ -121,10 +121,10 @@ dependencies:
121
121
  version: 0.8.0
122
122
  type: :runtime
123
123
  prerelease: false
124
- version_requirements: *70135708461860
124
+ version_requirements: *70268526304060
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: trollop
127
- requirement: &70135708459680 !ruby/object:Gem::Requirement
127
+ requirement: &70268526302940 !ruby/object:Gem::Requirement
128
128
  none: false
129
129
  requirements:
130
130
  - - =
@@ -132,10 +132,10 @@ dependencies:
132
132
  version: '2.0'
133
133
  type: :runtime
134
134
  prerelease: false
135
- version_requirements: *70135708459680
135
+ version_requirements: *70268526302940
136
136
  - !ruby/object:Gem::Dependency
137
137
  name: eventmachine
138
- requirement: &70135708477580 !ruby/object:Gem::Requirement
138
+ requirement: &70268526324000 !ruby/object:Gem::Requirement
139
139
  none: false
140
140
  requirements:
141
141
  - - =
@@ -143,10 +143,10 @@ dependencies:
143
143
  version: 1.0.0
144
144
  type: :runtime
145
145
  prerelease: false
146
- version_requirements: *70135708477580
146
+ version_requirements: *70268526324000
147
147
  - !ruby/object:Gem::Dependency
148
148
  name: em-websocket
149
- requirement: &70135708476120 !ruby/object:Gem::Requirement
149
+ requirement: &70268526320020 !ruby/object:Gem::Requirement
150
150
  none: false
151
151
  requirements:
152
152
  - - =
@@ -154,10 +154,10 @@ dependencies:
154
154
  version: 0.4.0
155
155
  type: :runtime
156
156
  prerelease: false
157
- version_requirements: *70135708476120
157
+ version_requirements: *70268526320020
158
158
  - !ruby/object:Gem::Dependency
159
159
  name: activesupport
160
- requirement: &70135708474900 !ruby/object:Gem::Requirement
160
+ requirement: &70268526317780 !ruby/object:Gem::Requirement
161
161
  none: false
162
162
  requirements:
163
163
  - - =
@@ -165,10 +165,10 @@ dependencies:
165
165
  version: 3.2.11
166
166
  type: :runtime
167
167
  prerelease: false
168
- version_requirements: *70135708474900
168
+ version_requirements: *70268526317780
169
169
  - !ruby/object:Gem::Dependency
170
170
  name: smartkiosk-common
171
- requirement: &70135708473460 !ruby/object:Gem::Requirement
171
+ requirement: &70268526332520 !ruby/object:Gem::Requirement
172
172
  none: false
173
173
  requirements:
174
174
  - - =
@@ -176,10 +176,10 @@ dependencies:
176
176
  version: 0.0.2
177
177
  type: :runtime
178
178
  prerelease: false
179
- version_requirements: *70135708473460
179
+ version_requirements: *70268526332520
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: sqlite3
182
- requirement: &70135708472200 !ruby/object:Gem::Requirement
182
+ requirement: &70268526331060 !ruby/object:Gem::Requirement
183
183
  none: false
184
184
  requirements:
185
185
  - - =
@@ -187,10 +187,10 @@ dependencies:
187
187
  version: 1.3.6
188
188
  type: :runtime
189
189
  prerelease: false
190
- version_requirements: *70135708472200
190
+ version_requirements: *70268526331060
191
191
  - !ruby/object:Gem::Dependency
192
192
  name: pg
193
- requirement: &70135708471500 !ruby/object:Gem::Requirement
193
+ requirement: &70268526329760 !ruby/object:Gem::Requirement
194
194
  none: false
195
195
  requirements:
196
196
  - - =
@@ -198,10 +198,10 @@ dependencies:
198
198
  version: 0.14.1
199
199
  type: :runtime
200
200
  prerelease: false
201
- version_requirements: *70135708471500
201
+ version_requirements: *70268526329760
202
202
  - !ruby/object:Gem::Dependency
203
203
  name: redis
204
- requirement: &70135708470640 !ruby/object:Gem::Requirement
204
+ requirement: &70268526327660 !ruby/object:Gem::Requirement
205
205
  none: false
206
206
  requirements:
207
207
  - - =
@@ -209,10 +209,10 @@ dependencies:
209
209
  version: 3.0.2
210
210
  type: :runtime
211
211
  prerelease: false
212
- version_requirements: *70135708470640
212
+ version_requirements: *70268526327660
213
213
  - !ruby/object:Gem::Dependency
214
214
  name: redis-objects
215
- requirement: &70135708488740 !ruby/object:Gem::Requirement
215
+ requirement: &70268526326240 !ruby/object:Gem::Requirement
216
216
  none: false
217
217
  requirements:
218
218
  - - =
@@ -220,10 +220,10 @@ dependencies:
220
220
  version: 0.6.1
221
221
  type: :runtime
222
222
  prerelease: false
223
- version_requirements: *70135708488740
223
+ version_requirements: *70268526326240
224
224
  - !ruby/object:Gem::Dependency
225
225
  name: carrierwave
226
- requirement: &70135708486840 !ruby/object:Gem::Requirement
226
+ requirement: &70268526324640 !ruby/object:Gem::Requirement
227
227
  none: false
228
228
  requirements:
229
229
  - - =
@@ -231,10 +231,10 @@ dependencies:
231
231
  version: 0.7.1
232
232
  type: :runtime
233
233
  prerelease: false
234
- version_requirements: *70135708486840
234
+ version_requirements: *70268526324640
235
235
  - !ruby/object:Gem::Dependency
236
236
  name: rest-client
237
- requirement: &70135708484300 !ruby/object:Gem::Requirement
237
+ requirement: &70268526342220 !ruby/object:Gem::Requirement
238
238
  none: false
239
239
  requirements:
240
240
  - - =
@@ -242,10 +242,10 @@ dependencies:
242
242
  version: 1.6.7
243
243
  type: :runtime
244
244
  prerelease: false
245
- version_requirements: *70135708484300
245
+ version_requirements: *70268526342220
246
246
  - !ruby/object:Gem::Dependency
247
247
  name: recursive-open-struct
248
- requirement: &70135708483220 !ruby/object:Gem::Requirement
248
+ requirement: &70268526337400 !ruby/object:Gem::Requirement
249
249
  none: false
250
250
  requirements:
251
251
  - - =
@@ -253,10 +253,10 @@ dependencies:
253
253
  version: 0.2.1
254
254
  type: :runtime
255
255
  prerelease: false
256
- version_requirements: *70135708483220
256
+ version_requirements: *70268526337400
257
257
  - !ruby/object:Gem::Dependency
258
258
  name: liquid
259
- requirement: &70135708482000 !ruby/object:Gem::Requirement
259
+ requirement: &70268526351520 !ruby/object:Gem::Requirement
260
260
  none: false
261
261
  requirements:
262
262
  - - =
@@ -264,10 +264,10 @@ dependencies:
264
264
  version: 2.4.1
265
265
  type: :runtime
266
266
  prerelease: false
267
- version_requirements: *70135708482000
267
+ version_requirements: *70268526351520
268
268
  - !ruby/object:Gem::Dependency
269
269
  name: file-tail
270
- requirement: &70135708481120 !ruby/object:Gem::Requirement
270
+ requirement: &70268526367940 !ruby/object:Gem::Requirement
271
271
  none: false
272
272
  requirements:
273
273
  - - =
@@ -275,10 +275,10 @@ dependencies:
275
275
  version: 1.0.12
276
276
  type: :runtime
277
277
  prerelease: false
278
- version_requirements: *70135708481120
278
+ version_requirements: *70268526367940
279
279
  - !ruby/object:Gem::Dependency
280
280
  name: rubyzip
281
- requirement: &70135708496060 !ruby/object:Gem::Requirement
281
+ requirement: &70268526365100 !ruby/object:Gem::Requirement
282
282
  none: false
283
283
  requirements:
284
284
  - - =
@@ -286,10 +286,10 @@ dependencies:
286
286
  version: 0.9.9
287
287
  type: :runtime
288
288
  prerelease: false
289
- version_requirements: *70135708496060
289
+ version_requirements: *70268526365100
290
290
  - !ruby/object:Gem::Dependency
291
291
  name: pry
292
- requirement: &70135708493560 !ruby/object:Gem::Requirement
292
+ requirement: &70268526396840 !ruby/object:Gem::Requirement
293
293
  none: false
294
294
  requirements:
295
295
  - - =
@@ -297,10 +297,10 @@ dependencies:
297
297
  version: 0.9.10
298
298
  type: :runtime
299
299
  prerelease: false
300
- version_requirements: *70135708493560
300
+ version_requirements: *70268526396840
301
301
  - !ruby/object:Gem::Dependency
302
302
  name: smartware
303
- requirement: &70135708492040 !ruby/object:Gem::Requirement
303
+ requirement: &70268526394660 !ruby/object:Gem::Requirement
304
304
  none: false
305
305
  requirements:
306
306
  - - =
@@ -308,10 +308,10 @@ dependencies:
308
308
  version: 0.4.3
309
309
  type: :runtime
310
310
  prerelease: false
311
- version_requirements: *70135708492040
311
+ version_requirements: *70268526394660
312
312
  - !ruby/object:Gem::Dependency
313
313
  name: smartguard
314
- requirement: &70135708489420 !ruby/object:Gem::Requirement
314
+ requirement: &70268526393420 !ruby/object:Gem::Requirement
315
315
  none: false
316
316
  requirements:
317
317
  - - =
@@ -319,10 +319,10 @@ dependencies:
319
319
  version: 0.4.2
320
320
  type: :runtime
321
321
  prerelease: false
322
- version_requirements: *70135708489420
322
+ version_requirements: *70268526393420
323
323
  - !ruby/object:Gem::Dependency
324
324
  name: sidekiq
325
- requirement: &70135708511280 !ruby/object:Gem::Requirement
325
+ requirement: &70268526392500 !ruby/object:Gem::Requirement
326
326
  none: false
327
327
  requirements:
328
328
  - - =
@@ -330,10 +330,10 @@ dependencies:
330
330
  version: 2.6.5
331
331
  type: :runtime
332
332
  prerelease: false
333
- version_requirements: *70135708511280
333
+ version_requirements: *70268526392500
334
334
  - !ruby/object:Gem::Dependency
335
335
  name: slim
336
- requirement: &70135708510600 !ruby/object:Gem::Requirement
336
+ requirement: &70268526390880 !ruby/object:Gem::Requirement
337
337
  none: false
338
338
  requirements:
339
339
  - - =
@@ -341,10 +341,10 @@ dependencies:
341
341
  version: 1.3.4
342
342
  type: :runtime
343
343
  prerelease: false
344
- version_requirements: *70135708510600
344
+ version_requirements: *70268526390880
345
345
  - !ruby/object:Gem::Dependency
346
346
  name: rufus-scheduler
347
- requirement: &70135708509040 !ruby/object:Gem::Requirement
347
+ requirement: &70268526411920 !ruby/object:Gem::Requirement
348
348
  none: false
349
349
  requirements:
350
350
  - - =
@@ -352,7 +352,7 @@ dependencies:
352
352
  version: 2.0.17
353
353
  type: :runtime
354
354
  prerelease: false
355
- version_requirements: *70135708509040
355
+ version_requirements: *70268526411920
356
356
  description: Smartkiosk client application
357
357
  email:
358
358
  - boris@roundlake.ru
@@ -452,7 +452,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
452
452
  version: '0'
453
453
  segments:
454
454
  - 0
455
- hash: -1891922174974161719
455
+ hash: -3780821335239314671
456
456
  required_rubygems_version: !ruby/object:Gem::Requirement
457
457
  none: false
458
458
  requirements:
@@ -461,7 +461,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
461
461
  version: '0'
462
462
  segments:
463
463
  - 0
464
- hash: -1891922174974161719
464
+ hash: -3780821335239314671
465
465
  requirements: []
466
466
  rubyforge_project:
467
467
  rubygems_version: 1.8.15