ishapi 0.1.8.129 → 0.1.8.134
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 +4 -4
- data/app/controllers/ishapi/application_controller.rb +68 -13
- data/app/controllers/ishapi/gameui_controller.rb +2 -2
- data/app/controllers/ishapi/my/my_controller.rb +19 -1
- data/app/controllers/ishapi/my/videos_controller.rb +14 -0
- data/app/controllers/ishapi/payments_controller.rb +74 -2
- data/app/controllers/ishapi/sites_controller.rb +3 -2
- data/app/controllers/ishapi/user_profiles_controller.rb +0 -5
- data/app/models/ishapi/ability.rb +16 -6
- data/app/views/ishapi/galleries/show.jbuilder +1 -3
- data/app/views/ishapi/{user_profiles/my.jbuilder → my/my/account.jbuilder} +2 -0
- data/app/views/ishapi/my/videos/index.jbuilder +9 -0
- data/app/views/ishapi/newsitems/_index.jbuilder +4 -4
- data/app/views/ishapi/photos/_index.jbuilder +1 -0
- data/app/views/ishapi/sites/show.jbuilder +2 -2
- data/config/routes.rb +15 -12
- metadata +8 -7
- data/app/controllers/ishapi/api_controller.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9055c8aee254cef203fa0ba8a7c82fd98d7c4b66870342d2286201ef7613dbd
|
4
|
+
data.tar.gz: eee54217f1e118989c390a1e7b73c49284f441504f661f1d4b189da385436720
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38e5d8e9948fd4c50e4df5045e1a3e8c2e8789b45b6f8697cd7f8b6d966cf48f59869ea73399e596e75457eeca9ea351d0f488e0e8bb9ee6029f0001829e3ca9
|
7
|
+
data.tar.gz: 0e633543d607411b971a437d9ad7f28f603a54754ff667ded394ac046fa9b2b64e4bdb2c0b1a1ae2ff1a8f13f6dc53ee0c284cd8148f7dbe0ba6acae1170bdfb
|
@@ -7,7 +7,7 @@ module Ishapi
|
|
7
7
|
|
8
8
|
# before_action :check_profile, except: [ :test ]
|
9
9
|
before_action :set_current_ability
|
10
|
-
|
10
|
+
|
11
11
|
check_authorization
|
12
12
|
skip_before_action :verify_authenticity_token
|
13
13
|
|
@@ -22,13 +22,32 @@ module Ishapi
|
|
22
22
|
|
23
23
|
params['domain'] = 'tgm.piousbox.com'
|
24
24
|
|
25
|
-
response = HTTParty.get "https://graph.facebook.com/v5.0/oauth/access_token?grant_type=fb_exchange_token&" +
|
25
|
+
response = ::HTTParty.get "https://graph.facebook.com/v5.0/oauth/access_token?grant_type=fb_exchange_token&" +
|
26
26
|
"client_id=#{FB[params['domain']][:app]}&client_secret=#{FB[params['domain']][:secret]}&" +
|
27
27
|
"fb_exchange_token=#{accessToken}"
|
28
28
|
j = JSON.parse response.body
|
29
|
-
@long_term_token
|
29
|
+
@long_term_token = j['access_token']
|
30
|
+
@graph = Koala::Facebook::API.new( accessToken )
|
31
|
+
@me = @graph.get_object( 'me', :fields => 'email' )
|
32
|
+
@current_user = User.where( :email => @me['email'] ).first
|
33
|
+
|
34
|
+
puts! @current_user, '#long_term_token @current_user'
|
35
|
+
|
36
|
+
# send the jwt to client
|
37
|
+
@jwt_token = encode(user_id: @current_user.id.to_s)
|
30
38
|
|
31
|
-
render json: {
|
39
|
+
render json: {
|
40
|
+
email: @current_user.email,
|
41
|
+
jwt_token: @jwt_token,
|
42
|
+
long_term_token: @long_term_token,
|
43
|
+
n_unlocks: @current_user.profile.n_unlocks,
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
def home
|
48
|
+
authorize! :welcome_home, Ishapi
|
49
|
+
render :json => { :status => :ok, :message => 'Ishapi::ApiController.home',
|
50
|
+
:n_reports => Report.count, :n_cities => City.count }
|
32
51
|
end
|
33
52
|
|
34
53
|
#
|
@@ -63,7 +82,6 @@ module Ishapi
|
|
63
82
|
## Does not crap out if accessToken is missing
|
64
83
|
def soft_check_long_term_token
|
65
84
|
check_long_term_token soft=true
|
66
|
-
# puts! @profile, 'soft_check_long_term_token() profile'
|
67
85
|
end
|
68
86
|
|
69
87
|
def check_multiprofile provider = 'google'
|
@@ -75,9 +93,9 @@ module Ishapi
|
|
75
93
|
# puts! result, 'googleauth result'
|
76
94
|
|
77
95
|
decoded_token = JWT.decode params[:idToken], nil, false
|
78
|
-
|
96
|
+
|
79
97
|
@current_user = User.find_by email: decoded_token[0]['email']
|
80
|
-
|
98
|
+
|
81
99
|
elsif 'facebook' == provider
|
82
100
|
# accessToken ||= params[:fb_long_access_token]
|
83
101
|
|
@@ -101,7 +119,7 @@ module Ishapi
|
|
101
119
|
@current_user = User.where( :email => @me['email'] ).first
|
102
120
|
@current_user ||= User.create! email: @me['email'], password: SecureRandom.urlsafe_base64
|
103
121
|
|
104
|
-
@current_profile = @current_user.profile
|
122
|
+
@current_profile = @current_user.profile
|
105
123
|
if !@current_profile
|
106
124
|
begin
|
107
125
|
g = Gallery.find '5e1495e2d697f768ad0779eb'
|
@@ -120,25 +138,50 @@ module Ishapi
|
|
120
138
|
|
121
139
|
puts! @current_user, 'current_user'
|
122
140
|
puts! @current_profile, 'current_profile'
|
123
|
-
|
141
|
+
|
142
|
+
elsif 'jwt' == provider
|
143
|
+
begin
|
144
|
+
decoded = decode(params[:jwt_token])
|
145
|
+
rescue JWT::ExpiredSignature
|
146
|
+
# @TODO: refactor [ref-5]
|
147
|
+
@current_user = User.new profile: Profile.new
|
148
|
+
sign_in @current_user, scope: :user
|
149
|
+
set_current_ability
|
150
|
+
return
|
151
|
+
end
|
152
|
+
@current_user = User.find decoded['user_id']
|
153
|
+
|
124
154
|
else
|
125
155
|
puts! 'check_multiprofile(): no access token'
|
156
|
+
raise "ww1 - not implemented"
|
126
157
|
end
|
127
158
|
|
159
|
+
# @TODO: refactor [ref-5]
|
128
160
|
sign_in @current_user, scope: :user
|
129
161
|
set_current_ability
|
130
162
|
end
|
131
163
|
|
164
|
+
# same as check_profile but doesn't error out when jwt_token is missing
|
165
|
+
def check_profile_optionally
|
166
|
+
if !params[:jwt_token]
|
167
|
+
@current_user = User.new profile: Profile.new
|
168
|
+
else
|
169
|
+
check_profile
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
132
173
|
# this doesn't generate long-lived token, doesn't update user_profile
|
133
|
-
# this is only for facebook now
|
134
174
|
def check_profile
|
175
|
+
puts! params, 'params'
|
176
|
+
|
135
177
|
# return check_multiprofile 'google'
|
136
|
-
return check_multiprofile 'facebook'
|
178
|
+
# return check_multiprofile 'facebook'
|
179
|
+
return check_multiprofile 'jwt'
|
137
180
|
|
138
181
|
# puts! params, 'params'
|
139
182
|
# puts! current_user, 'current_user'
|
140
183
|
# puts! @current_user, '@current_user'
|
141
|
-
|
184
|
+
|
142
185
|
accessToken = request.headers[:accessToken]
|
143
186
|
accessToken ||= params[:fb_long_access_token]
|
144
187
|
accessToken ||= params[:accessToken]
|
@@ -201,7 +244,7 @@ module Ishapi
|
|
201
244
|
@current_order = @current_profile.current_order
|
202
245
|
# orders.where( :submitted_at => nil ).first || ::CoTailors::Order.new( :profile_id => @current_profile.id )
|
203
246
|
end
|
204
|
-
|
247
|
+
|
205
248
|
def get_long_token accessToken
|
206
249
|
url = "https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&" +
|
207
250
|
"client_id=#{FB[params['domain']][:app]}&client_secret=#{FB[params['domain']][:secret]}&fb_exchange_token=#{accessToken}"
|
@@ -221,5 +264,17 @@ module Ishapi
|
|
221
264
|
puts a.inspect
|
222
265
|
end
|
223
266
|
|
267
|
+
# jwt
|
268
|
+
def encode(payload, exp = 2.hours.from_now)
|
269
|
+
payload[:exp] = exp.to_i
|
270
|
+
JWT.encode(payload, Rails.application.secrets.secret_key_base.to_s)
|
271
|
+
end
|
272
|
+
|
273
|
+
# jwt
|
274
|
+
def decode(token)
|
275
|
+
decoded = JWT.decode(token, Rails.application.secrets.secret_key_base.to_s)[0]
|
276
|
+
HashWithIndifferentAccess.new decoded
|
277
|
+
end
|
278
|
+
|
224
279
|
end
|
225
280
|
end
|
@@ -21,7 +21,7 @@ module Ishapi
|
|
21
21
|
:amount => params[:amount],
|
22
22
|
:currency => 'usd',
|
23
23
|
:source => params[:stripeToken],
|
24
|
-
:destination => {
|
24
|
+
:destination => {
|
25
25
|
:account => acct,
|
26
26
|
}
|
27
27
|
)
|
@@ -46,7 +46,7 @@ module Ishapi
|
|
46
46
|
def do_purchase
|
47
47
|
authorize! :do_purchase, ::Gameui
|
48
48
|
item = params[:className].constantize.find_by_slug( params[:slug] )
|
49
|
-
|
49
|
+
|
50
50
|
raise 'no such item' if !item
|
51
51
|
raise 'too little funds' if @profile.n_stars < item.premium_tier
|
52
52
|
|
@@ -3,10 +3,28 @@ module Ishapi
|
|
3
3
|
module My
|
4
4
|
class MyController < Ishapi::ApplicationController
|
5
5
|
|
6
|
-
before_action :set_profile
|
6
|
+
# before_action :set_profile # this is DoS on FB - disabled
|
7
|
+
# before_action :do_login
|
8
|
+
before_action :check_profile
|
9
|
+
|
10
|
+
def account
|
11
|
+
puts! params, 'my account'
|
12
|
+
|
13
|
+
@profile = current_user.profile
|
14
|
+
authorize! :show, @profile
|
15
|
+
end
|
16
|
+
|
7
17
|
|
8
18
|
private
|
9
19
|
|
20
|
+
def do_login
|
21
|
+
puts! params, 'params'
|
22
|
+
|
23
|
+
token = decode(params[:jwtToken])
|
24
|
+
puts! token, 'token'
|
25
|
+
@current_user = User.find(token["user_id"])
|
26
|
+
end
|
27
|
+
|
10
28
|
def set_profile
|
11
29
|
begin
|
12
30
|
@graph = Koala::Facebook::API.new( params[:accessToken] )
|
@@ -0,0 +1,14 @@
|
|
1
|
+
|
2
|
+
module Ishapi
|
3
|
+
module My
|
4
|
+
class VideosController < Ishapi::My::MyController
|
5
|
+
|
6
|
+
def index
|
7
|
+
authorize! :my_index, Video
|
8
|
+
@videos = @current_user.profile.videos.unscoped.where( is_trash: false ).order_by( created_at: :desc ).limit(20)
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
@@ -2,6 +2,12 @@ require_dependency "ishapi/application_controller"
|
|
2
2
|
module Ishapi
|
3
3
|
class PaymentsController < ApplicationController
|
4
4
|
|
5
|
+
before_action :check_profile, only: %i| create2 unlock |
|
6
|
+
|
7
|
+
##
|
8
|
+
## this is for invoices on wasya.co, isn't it?
|
9
|
+
## 20200712
|
10
|
+
##
|
5
11
|
def create
|
6
12
|
authorize! :open_permission, ::Ishapi
|
7
13
|
begin
|
@@ -18,11 +24,10 @@ module Ishapi
|
|
18
24
|
:amount => amount_cents,
|
19
25
|
:currency => 'usd',
|
20
26
|
:source => params[:token][:id],
|
21
|
-
:destination => {
|
27
|
+
:destination => {
|
22
28
|
:account => acct,
|
23
29
|
}
|
24
30
|
)
|
25
|
-
# puts! charge, 'charge'
|
26
31
|
|
27
32
|
payment.charge = JSON.parse( charge.to_json )
|
28
33
|
if payment.save
|
@@ -36,6 +41,73 @@ module Ishapi
|
|
36
41
|
end
|
37
42
|
end
|
38
43
|
|
44
|
+
## This is for guyd _vp_ 20200721
|
45
|
+
def create2
|
46
|
+
authorize! :create, ::Ish::Payment
|
47
|
+
|
48
|
+
begin
|
49
|
+
amount_cents = 503 # @TODO: change
|
50
|
+
|
51
|
+
::Stripe.api_key = STRIPE_SK
|
52
|
+
intent = Stripe::PaymentIntent.create({
|
53
|
+
amount: amount_cents,
|
54
|
+
currency: 'usd',
|
55
|
+
metadata: { integration_check: "accept_a_payment" },
|
56
|
+
})
|
57
|
+
|
58
|
+
payment = Ish::Payment.create!(
|
59
|
+
client_secret: intent.client_secret,
|
60
|
+
email: @current_user.email,
|
61
|
+
payment_intent_id: intent.id,
|
62
|
+
profile_id: @current_user.profile.id )
|
63
|
+
|
64
|
+
render json: { client_secret: intent.client_secret }
|
65
|
+
rescue Mongoid::Errors::DocumentNotFound => e
|
66
|
+
puts! e, 'e'
|
67
|
+
render :status => 404, :json => e
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
## webhook
|
72
|
+
def stripe_confirm
|
73
|
+
authorize! :open_permission, ::Ishapi
|
74
|
+
payload = request.body.read
|
75
|
+
event = nil
|
76
|
+
begin
|
77
|
+
event = Stripe::Event.construct_from(JSON.parse(payload, symbolize_names: true))
|
78
|
+
rescue StandardError => e
|
79
|
+
puts! e, 'e'
|
80
|
+
render status: 400, json: { status: :not_ok }
|
81
|
+
return
|
82
|
+
end
|
83
|
+
|
84
|
+
payment_intent = event.data.object
|
85
|
+
|
86
|
+
payment = Ish::Payment.where( payment_intent_id: payment_intent.id ).first
|
87
|
+
if payment && payment_intent['status'] == 'succeeded'
|
88
|
+
payment.update_attributes( status: :confirmed )
|
89
|
+
payment.profile.update_attributes!( n_unlocks: payment.profile.n_unlocks + 5 )
|
90
|
+
end
|
91
|
+
|
92
|
+
render status: 200, json: { status: :ok }
|
93
|
+
end
|
94
|
+
|
95
|
+
def unlock
|
96
|
+
authorize! :unlock, ::Ish::Payment
|
97
|
+
item = Object::const_get(params['kind']).find params['id']
|
98
|
+
|
99
|
+
existing = Purchase.where( user_profile: @current_user.profile, item: item ).first
|
100
|
+
if existing
|
101
|
+
render status: 200, json: { status: :ok, message: 'already purchased' }
|
102
|
+
return
|
103
|
+
end
|
104
|
+
|
105
|
+
@current_user.profile.update_attributes n_unlocks: @current_user.profile.n_unlocks - 1 # @TODO: the number is variable
|
106
|
+
purchase = ::Gameui::PremiumPurchase.create!( item: item, user_profile: @current_user.profile, )
|
107
|
+
|
108
|
+
render status: 200, json: { status: :ok }
|
109
|
+
end
|
110
|
+
|
39
111
|
end
|
40
112
|
end
|
41
113
|
|
@@ -3,6 +3,8 @@ require_dependency "ishapi/application_controller"
|
|
3
3
|
module Ishapi
|
4
4
|
class SitesController < ApplicationController
|
5
5
|
|
6
|
+
before_action :check_profile_optionally, only: %i| show |
|
7
|
+
|
6
8
|
def index
|
7
9
|
authorize! :index, ::Site
|
8
10
|
@sites = ::Site.all
|
@@ -14,10 +16,9 @@ module Ishapi
|
|
14
16
|
else
|
15
17
|
domain = params[:domain]
|
16
18
|
end
|
17
|
-
@site = ::Site.find_by
|
19
|
+
@site = ::Site.find_by(domain: domain, lang: :en)
|
18
20
|
authorize! :show, @site
|
19
21
|
|
20
|
-
|
21
22
|
if @site.is_private
|
22
23
|
if !params[:accessToken]
|
23
24
|
render :json => { :status => :unauthorized}, :status => :unauthorized
|
@@ -13,15 +13,17 @@ class Ishapi::Ability
|
|
13
13
|
can :manage, :all
|
14
14
|
end
|
15
15
|
|
16
|
+
can [ :update ], ::CoTailors::Address do |address|
|
17
|
+
puts [ user.inspect, address.inspect ], '+++ user in cancancan'
|
18
|
+
true
|
19
|
+
end
|
20
|
+
|
16
21
|
can [ :show ], Gallery do |gallery|
|
17
22
|
gallery.user_profile == user.profile
|
18
23
|
end
|
19
24
|
can [ :do_purchase ], ::Gameui
|
20
25
|
|
21
|
-
can [ :
|
22
|
-
puts [ user.inspect, address.inspect ], '+++ user in cancancan'
|
23
|
-
true
|
24
|
-
end
|
26
|
+
can [ :create, :unlock ], ::Ish::Payment
|
25
27
|
|
26
28
|
can [ :buy_stars ], ::IshModels::UserProfile
|
27
29
|
|
@@ -42,6 +44,11 @@ class Ishapi::Ability
|
|
42
44
|
|
43
45
|
can [ :index, :show ], Event
|
44
46
|
|
47
|
+
#
|
48
|
+
# Ish::P
|
49
|
+
#
|
50
|
+
|
51
|
+
|
45
52
|
#
|
46
53
|
# G
|
47
54
|
#
|
@@ -56,7 +63,7 @@ class Ishapi::Ability
|
|
56
63
|
can [ :my_index, :show ], Report do |report|
|
57
64
|
report.is_public
|
58
65
|
end
|
59
|
-
|
66
|
+
|
60
67
|
can [ :fb_sign_in, :long_term_token, :open_permission, :welcome_home ], Ishapi
|
61
68
|
|
62
69
|
can [ :index, :show ], Site
|
@@ -66,11 +73,14 @@ class Ishapi::Ability
|
|
66
73
|
tag.is_public
|
67
74
|
end
|
68
75
|
|
76
|
+
#
|
77
|
+
# V
|
78
|
+
#
|
69
79
|
can [ :index ], Venue
|
70
80
|
can [ :show ], Venue do |venue|
|
71
81
|
venue.is_public
|
72
82
|
end
|
73
|
-
can [ :index ], Video
|
83
|
+
can [ :index, :my_index ], Video
|
74
84
|
can [ :show ], Video do |video|
|
75
85
|
video.is_public
|
76
86
|
end
|
@@ -5,10 +5,8 @@
|
|
5
5
|
this_key = [ @gallery, params.permit! ]
|
6
6
|
json.cache! this_key do
|
7
7
|
json.gallery do
|
8
|
-
json.partial! 'ishapi/galleries/show', gallery: @gallery
|
9
|
-
json.partial! 'ishapi/photos/index', :photos => @gallery.photos
|
10
|
-
|
11
8
|
json.partial! 'ishapi/application/meta', item: @gallery
|
9
|
+
json.partial! 'ishapi/galleries/show', gallery: @gallery
|
12
10
|
end
|
13
11
|
end
|
14
12
|
|
@@ -10,7 +10,7 @@ json.newsitems do
|
|
10
10
|
json.name item.name
|
11
11
|
json.created_at item.created_at
|
12
12
|
json.updated_at item.updated_at
|
13
|
-
|
13
|
+
|
14
14
|
if item.gallery
|
15
15
|
json.item_type 'gallery'
|
16
16
|
json.name item.gallery.name
|
@@ -39,7 +39,7 @@ json.newsitems do
|
|
39
39
|
json.username item.report.user_profile.name if item.report.user_profile
|
40
40
|
|
41
41
|
if item.report.photo
|
42
|
-
json.photo_s169_url item.report.photo.photo.url( :s169 )
|
42
|
+
json.photo_s169_url item.report.photo.photo.url( :s169 )
|
43
43
|
json.photo_thumb2_url item.report.photo.photo.url( :thumb2 )
|
44
44
|
end
|
45
45
|
|
@@ -51,7 +51,7 @@ json.newsitems do
|
|
51
51
|
json.is_purchased current_user.profile.has_premium_purchase( item.report )
|
52
52
|
end
|
53
53
|
end
|
54
|
-
|
54
|
+
|
55
55
|
if item.video_id
|
56
56
|
json.partial! 'ishapi/videos/show', :video => Video.unscoped.find( item.video_id )
|
57
57
|
end
|
@@ -60,6 +60,6 @@ json.newsitems do
|
|
60
60
|
json.item_type 'photo'
|
61
61
|
json.partial! 'ishapi/photos/index', :photos => [ item.photo ]
|
62
62
|
end
|
63
|
-
|
63
|
+
|
64
64
|
end
|
65
65
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
|
2
2
|
#
|
3
3
|
# ishapi / sites / show
|
4
4
|
#
|
@@ -22,7 +22,7 @@ json.cache! key do
|
|
22
22
|
json.partial! 'ishapi/newsitems/index', :newsitems => @newsitems, :resource => @site
|
23
23
|
json.partial! 'ishapi/reports/index', :reports => @reports, :resource => @site
|
24
24
|
json.partial! 'ishapi/videos/index', :videos => @site.videos
|
25
|
-
|
25
|
+
|
26
26
|
json.feature_tags do
|
27
27
|
json.array! @feature_tags do |feature_tag|
|
28
28
|
json.partial! 'ishapi/tags/widget', :tag => feature_tag
|
data/config/routes.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
Ishapi::Engine.routes.draw do
|
2
|
-
root :to => '
|
3
|
-
post 'home', :to => '
|
2
|
+
root :to => 'application#home'
|
3
|
+
post 'home', :to => 'application#home'
|
4
4
|
|
5
5
|
resources :addresses
|
6
6
|
|
7
7
|
get 'cities', :to => 'cities#index'
|
8
8
|
get 'cities/view/:cityname', :to => 'cities#show'
|
9
9
|
get 'cities/features', :to => 'cities#features'
|
10
|
-
|
10
|
+
|
11
11
|
post 'co_tailors/orders', :to => 'orders#create'
|
12
12
|
post 'co_tailors/order_items', :to => 'order_items#create'
|
13
13
|
post 'co_tailors/measurements', :to => 'measurements#update'
|
@@ -15,8 +15,6 @@ Ishapi::Engine.routes.draw do
|
|
15
15
|
namespace :co_tailors do
|
16
16
|
end
|
17
17
|
|
18
|
-
post 'do_purchase', to: 'gameui#do_purchase'
|
19
|
-
|
20
18
|
get 'events/view/:eventname', :to => 'events#show'
|
21
19
|
|
22
20
|
get 'galleries', :to => 'galleries#index'
|
@@ -29,15 +27,20 @@ Ishapi::Engine.routes.draw do
|
|
29
27
|
get 'maps', to: 'maps#index'
|
30
28
|
get 'maps/view/:slug', to: 'maps#show'
|
31
29
|
get 'markers/view/:slug', to: 'maps#show_marker'
|
32
|
-
|
33
|
-
get 'my/newsitems', to: 'newsitems#index'
|
34
|
-
get 'my/account', to: 'user_profiles#my'
|
30
|
+
get "/my/account", to: "my/my#account"
|
35
31
|
namespace :my do
|
36
|
-
|
37
|
-
get 'reports',
|
32
|
+
get 'newsitems', to: 'newsitems#index'
|
33
|
+
get 'reports', to: 'reports#index'
|
34
|
+
get 'videos', to: 'videos#index'
|
35
|
+
post 'videos', to: 'videos#index'
|
38
36
|
end
|
39
|
-
|
37
|
+
|
38
|
+
post 'do_purchase', to: 'gameui#do_purchase' # @TODO: rename to just purchase, or destroy endpoint
|
40
39
|
post 'payments', :to => 'payments#create'
|
40
|
+
post 'payments2', :to => 'payments#create2' # @TODO: change
|
41
|
+
get 'payments2', to: 'payments#create2'
|
42
|
+
post 'payments/unlock', to: 'payments#unlock' # do_purchase
|
43
|
+
post 'stripe_confirm', to: 'payments#stripe_confirm' # @TODO: test-drive
|
41
44
|
|
42
45
|
get 'profiles/view/:username', :to => 'user_profiles#show'
|
43
46
|
|
@@ -64,7 +67,7 @@ Ishapi::Engine.routes.draw do
|
|
64
67
|
|
65
68
|
get 'venues', :to => 'venues#index'
|
66
69
|
get 'venues/view/:venuename', :to => 'venues#show'
|
67
|
-
|
70
|
+
|
68
71
|
resources :videos
|
69
72
|
|
70
73
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ishapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.8.
|
4
|
+
version: 0.1.8.134
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -195,7 +195,6 @@ files:
|
|
195
195
|
- app/assets/stylesheets/ishapi/articles.css
|
196
196
|
- app/assets/stylesheets/scaffold.css
|
197
197
|
- app/controllers/ishapi/addresses_controller.rb
|
198
|
-
- app/controllers/ishapi/api_controller.rb
|
199
198
|
- app/controllers/ishapi/application_controller.rb
|
200
199
|
- app/controllers/ishapi/articles_controller.rb
|
201
200
|
- app/controllers/ishapi/cities_controller.rb
|
@@ -207,6 +206,7 @@ files:
|
|
207
206
|
- app/controllers/ishapi/measurements_controller.rb
|
208
207
|
- app/controllers/ishapi/my/my_controller.rb
|
209
208
|
- app/controllers/ishapi/my/reports_controller.rb
|
209
|
+
- app/controllers/ishapi/my/videos_controller.rb
|
210
210
|
- app/controllers/ishapi/newsitems_controller.rb
|
211
211
|
- app/controllers/ishapi/order_items_controller.rb
|
212
212
|
- app/controllers/ishapi/orders_controller.rb
|
@@ -248,6 +248,8 @@ files:
|
|
248
248
|
- app/views/ishapi/maps/index.jbuilder
|
249
249
|
- app/views/ishapi/maps/show.jbuilder
|
250
250
|
- app/views/ishapi/measurements/_show.jbuilder
|
251
|
+
- app/views/ishapi/my/my/account.jbuilder
|
252
|
+
- app/views/ishapi/my/videos/index.jbuilder
|
251
253
|
- app/views/ishapi/newsitems/_index.jbuilder
|
252
254
|
- app/views/ishapi/newsitems/index.jbuilder
|
253
255
|
- app/views/ishapi/orders/_item.jbuilder
|
@@ -263,7 +265,6 @@ files:
|
|
263
265
|
- app/views/ishapi/tags/_widget.jbuilder
|
264
266
|
- app/views/ishapi/tags/index.jbuilder
|
265
267
|
- app/views/ishapi/tags/show.jbuilder
|
266
|
-
- app/views/ishapi/user_profiles/my.jbuilder
|
267
268
|
- app/views/ishapi/user_profiles/show.jbuilder
|
268
269
|
- app/views/ishapi/users/_index.jbuilder
|
269
270
|
- app/views/ishapi/users/show.jbuilder
|
@@ -282,7 +283,7 @@ homepage: http://wasya.co
|
|
282
283
|
licenses:
|
283
284
|
- MIT
|
284
285
|
metadata: {}
|
285
|
-
post_install_message:
|
286
|
+
post_install_message:
|
286
287
|
rdoc_options: []
|
287
288
|
require_paths:
|
288
289
|
- lib
|
@@ -298,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
298
299
|
version: '0'
|
299
300
|
requirements: []
|
300
301
|
rubygems_version: 3.0.6
|
301
|
-
signing_key:
|
302
|
+
signing_key:
|
302
303
|
specification_version: 4
|
303
304
|
summary: Summary of Ishapi.
|
304
305
|
test_files: []
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require_dependency "ishapi/application_controller"
|
2
|
-
|
3
|
-
module Ishapi
|
4
|
-
class ApiController < UnrestrictedController
|
5
|
-
|
6
|
-
def home
|
7
|
-
authorize! :welcome_home, Ishapi
|
8
|
-
render :json => { :status => :ok, :message => 'Ishapi::ApiController.home',
|
9
|
-
:n_reports => Report.count, :n_cities => City.count }
|
10
|
-
end
|
11
|
-
|
12
|
-
end
|
13
|
-
end
|