smartkiosk-server 0.12 → 0.12.1
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.
@@ -36,18 +36,20 @@ class PaymentsController < ApplicationController
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def offline
|
39
|
+
params[:payment].merge! :offline => true
|
40
|
+
|
39
41
|
payment = Payment.build!(@terminal, Provider.find_by_keyword(params[:provider]), params[:payment])
|
40
42
|
payment.check!
|
41
43
|
payment.enqueue! if payment.checked?
|
42
44
|
|
43
|
-
|
45
|
+
render_payment payment
|
44
46
|
end
|
45
47
|
|
46
48
|
def pay
|
47
49
|
payment = @terminal.payments.find(params[:id])
|
48
50
|
payment.pay!(params[:payment])
|
49
51
|
|
50
|
-
|
52
|
+
render_payment payment
|
51
53
|
end
|
52
54
|
|
53
55
|
def enqueue
|
@@ -60,6 +62,23 @@ class PaymentsController < ApplicationController
|
|
60
62
|
def show
|
61
63
|
payment = @terminal.payments.find(params[:id])
|
62
64
|
|
63
|
-
|
65
|
+
render_payment payment
|
64
66
|
end
|
67
|
+
|
68
|
+
private
|
69
|
+
|
70
|
+
def render_payment(payment)
|
71
|
+
render :json => payment.as_json(:only => [
|
72
|
+
:id,
|
73
|
+
:state,
|
74
|
+
:gateway_payment_id,
|
75
|
+
:acquirer_error,
|
76
|
+
:gateway_error,
|
77
|
+
:commission_amount,
|
78
|
+
:enrolled_amount,
|
79
|
+
:rebate_amount,
|
80
|
+
:created_at
|
81
|
+
])
|
82
|
+
end
|
83
|
+
|
65
84
|
end
|
data/app/models/payment.rb
CHANGED
@@ -35,10 +35,6 @@ class Payment < ActiveRecord::Base
|
|
35
35
|
transitions :from => [:checked, :queue], :to => [:paid, :error], :decide => :pay?
|
36
36
|
end
|
37
37
|
|
38
|
-
event :pay_offline do
|
39
|
-
transitions :from => :new, :to => [:paid, :error], :decide => :pay_offline?
|
40
|
-
end
|
41
|
-
|
42
38
|
event :pay_manually do
|
43
39
|
transitions :from => :error, :to => :manual
|
44
40
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smartkiosk-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.12.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -335,7 +335,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
335
335
|
version: '0'
|
336
336
|
segments:
|
337
337
|
- 0
|
338
|
-
hash:
|
338
|
+
hash: -4360942284115096697
|
339
339
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
340
340
|
none: false
|
341
341
|
requirements:
|