ishapi 0.1.8.133 → 0.1.8.138
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/README.md +7 -0
- data/app/controllers/ishapi/application_controller.rb +51 -30
- data/app/controllers/ishapi/galleries_controller.rb +2 -1
- data/app/controllers/ishapi/gameui_controller.rb +2 -2
- data/app/controllers/ishapi/my/galleries_controller.rb +12 -0
- data/app/controllers/ishapi/my/my_controller.rb +7 -4
- 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 -7
- data/app/models/ishapi/ability.rb +12 -5
- data/app/views/ishapi/galleries/index.jbuilder +1 -1
- data/app/views/ishapi/{user_profiles/my.jbuilder → my/my/account.jbuilder} +2 -0
- data/app/views/ishapi/newsitems/_index.jbuilder +4 -4
- data/app/views/ishapi/sites/show.jbuilder +2 -2
- data/config/routes.rb +13 -11
- metadata +7 -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: 484a021badac24fd7cc60e51878246515d9f5a7c0061bc03a530161a9ca52be5
|
4
|
+
data.tar.gz: 69fba225c87c16878d240c94956616cfab4ef3e1a8f3f3214435c2683fa796df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97b91683c848f49d69fb0df659923dbea16d45c0fcbe0f5ef30b8b48e70f7b59783ae6fd6097cba14e0942c98d789bad17f1dc752c231525ef8dda79b3620b3a
|
7
|
+
data.tar.gz: 475504a104554c49b03c937148daf096ae043381bee59d5d9b2baae2e2847f32e432593c63d85849af497d27b3d4ca69937665e422a785b0e0849db608672e79
|
data/README.md
CHANGED
@@ -1,12 +1,19 @@
|
|
1
1
|
|
2
2
|
# Develop
|
3
3
|
|
4
|
+
-=----- 20201228
|
5
|
+
|
6
|
+
Expects params[:jwtToken]
|
7
|
+
no... expects params[:accessToken]
|
8
|
+
somehow expects params[:jwt_token] ?
|
9
|
+
|
4
10
|
# Test
|
5
11
|
|
6
12
|
cd test/dummy
|
7
13
|
be rspec spec
|
8
14
|
|
9
15
|
# Install
|
16
|
+
|
10
17
|
bundle
|
11
18
|
gem build ishapi.gemspec
|
12
19
|
|
@@ -5,40 +5,42 @@ module Ishapi
|
|
5
5
|
protect_from_forgery :prepend => true, :with => :exception
|
6
6
|
layout :false
|
7
7
|
|
8
|
-
|
9
|
-
before_action :set_current_ability
|
10
|
-
|
11
|
-
check_authorization
|
8
|
+
check_authorization except: [ :long_term_token ]
|
12
9
|
skip_before_action :verify_authenticity_token
|
13
10
|
|
14
11
|
def test
|
15
12
|
end
|
16
13
|
|
17
14
|
def long_term_token
|
18
|
-
authorize! :long_term_token, ::Ishapi
|
19
|
-
|
20
15
|
accessToken = request.headers[:accessToken]
|
21
16
|
accessToken ||= params[:accessToken]
|
22
17
|
|
23
18
|
params['domain'] = 'tgm.piousbox.com'
|
24
19
|
|
25
|
-
response = HTTParty.get "https://graph.facebook.com/v5.0/oauth/access_token?grant_type=fb_exchange_token&" +
|
20
|
+
response = ::HTTParty.get "https://graph.facebook.com/v5.0/oauth/access_token?grant_type=fb_exchange_token&" +
|
26
21
|
"client_id=#{FB[params['domain']][:app]}&client_secret=#{FB[params['domain']][:secret]}&" +
|
27
22
|
"fb_exchange_token=#{accessToken}"
|
28
23
|
j = JSON.parse response.body
|
29
|
-
|
30
|
-
@long_term_token = j['access_token']
|
31
|
-
|
32
|
-
# get user email
|
24
|
+
@long_term_token = j['access_token']
|
33
25
|
@graph = Koala::Facebook::API.new( accessToken )
|
34
26
|
@me = @graph.get_object( 'me', :fields => 'email' )
|
35
27
|
@current_user = User.where( :email => @me['email'] ).first
|
36
|
-
@profile = @current_user.profile
|
37
28
|
|
38
29
|
# send the jwt to client
|
39
|
-
@jwt_token = encode(user_id: @current_user.id)
|
30
|
+
@jwt_token = encode(user_id: @current_user.id.to_s)
|
31
|
+
|
32
|
+
render json: {
|
33
|
+
email: @current_user.email,
|
34
|
+
jwt_token: @jwt_token,
|
35
|
+
long_term_token: @long_term_token,
|
36
|
+
n_unlocks: @current_user.profile.n_unlocks,
|
37
|
+
}
|
38
|
+
end
|
40
39
|
|
41
|
-
|
40
|
+
def home
|
41
|
+
authorize! :welcome_home, Ishapi
|
42
|
+
render :json => { :status => :ok, :message => 'Ishapi::ApiController.home',
|
43
|
+
:n_reports => Report.count, :n_cities => City.count }
|
42
44
|
end
|
43
45
|
|
44
46
|
#
|
@@ -70,10 +72,10 @@ module Ishapi
|
|
70
72
|
end
|
71
73
|
end
|
72
74
|
end
|
75
|
+
|
73
76
|
## Does not crap out if accessToken is missing
|
74
77
|
def soft_check_long_term_token
|
75
78
|
check_long_term_token soft=true
|
76
|
-
# puts! @profile, 'soft_check_long_term_token() profile'
|
77
79
|
end
|
78
80
|
|
79
81
|
def check_multiprofile provider = 'google'
|
@@ -128,25 +130,36 @@ module Ishapi
|
|
128
130
|
@current_user = current_user if Rails.env.test?
|
129
131
|
end
|
130
132
|
|
131
|
-
puts! @current_user, 'current_user'
|
132
|
-
puts! @current_profile, 'current_profile'
|
133
|
-
|
134
133
|
elsif 'jwt' == provider
|
135
134
|
decoded = decode(params[:jwt_token])
|
136
|
-
|
137
|
-
@current_user = User.find decoded[:user_id]
|
138
|
-
|
135
|
+
@current_user = User.find decoded['user_id']
|
139
136
|
else
|
140
137
|
puts! 'check_multiprofile(): no access token'
|
141
138
|
raise "ww1 - not implemented"
|
142
139
|
end
|
143
140
|
|
141
|
+
# @TODO: refactor [ref-5]
|
144
142
|
sign_in @current_user, scope: :user
|
145
|
-
|
143
|
+
current_ability
|
144
|
+
end
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
# same as check_profile but doesn't error out when jwt_token is missing or expired
|
149
|
+
def check_profile_optionally
|
150
|
+
if !params[:jwt_token]
|
151
|
+
@current_user = User.new profile: Profile.new
|
152
|
+
else
|
153
|
+
begin
|
154
|
+
check_profile
|
155
|
+
rescue JWT::ExpiredSignature
|
156
|
+
Rails.logger.info("JWT::ExpiredSignature")
|
157
|
+
@current_user = User.new profile: Profile.new
|
158
|
+
end
|
159
|
+
end
|
146
160
|
end
|
147
161
|
|
148
162
|
# this doesn't generate long-lived token, doesn't update user_profile
|
149
|
-
# this is only for facebook now
|
150
163
|
def check_profile
|
151
164
|
puts! params, 'params'
|
152
165
|
|
@@ -154,10 +167,6 @@ module Ishapi
|
|
154
167
|
# return check_multiprofile 'facebook'
|
155
168
|
return check_multiprofile 'jwt'
|
156
169
|
|
157
|
-
# puts! params, 'params'
|
158
|
-
# puts! current_user, 'current_user'
|
159
|
-
# puts! @current_user, '@current_user'
|
160
|
-
|
161
170
|
accessToken = request.headers[:accessToken]
|
162
171
|
accessToken ||= params[:fb_long_access_token]
|
163
172
|
accessToken ||= params[:accessToken]
|
@@ -229,10 +238,9 @@ module Ishapi
|
|
229
238
|
return token # ['access_token']
|
230
239
|
end
|
231
240
|
|
232
|
-
def
|
233
|
-
# puts! current_user.email, '#set_current_ability() :: @current_user'
|
241
|
+
def current_ability
|
234
242
|
@current_user ||= User.new({ profile: ::IshModels::UserProfile.new })
|
235
|
-
@current_ability ||=
|
243
|
+
@current_ability ||= Ishapi::Ability.new( @current_user )
|
236
244
|
end
|
237
245
|
|
238
246
|
def puts! a, b=''
|
@@ -240,6 +248,19 @@ module Ishapi
|
|
240
248
|
puts a.inspect
|
241
249
|
end
|
242
250
|
|
251
|
+
# jwt
|
252
|
+
def check_jwt
|
253
|
+
begin
|
254
|
+
decoded = decode(params[:jwt_token])
|
255
|
+
puts! decoded, 'decoded'
|
256
|
+
@current_user = User.find decoded['user_id']
|
257
|
+
rescue JWT::ExpiredSignature
|
258
|
+
Rails.logger.info("JWT::ExpiredSignature")
|
259
|
+
@current_user = User.new
|
260
|
+
end
|
261
|
+
current_ability
|
262
|
+
end
|
263
|
+
|
243
264
|
# jwt
|
244
265
|
def encode(payload, exp = 2.hours.from_now)
|
245
266
|
payload[:exp] = exp.to_i
|
@@ -3,7 +3,8 @@ require_dependency "ishapi/application_controller"
|
|
3
3
|
module Ishapi
|
4
4
|
class GalleriesController < ApplicationController
|
5
5
|
|
6
|
-
before_action :soft_check_long_term_token, only: [ :show ]
|
6
|
+
# before_action :soft_check_long_term_token, only: [ :show ]
|
7
|
+
before_action :check_jwt
|
7
8
|
|
8
9
|
def index
|
9
10
|
@galleries = Gallery.all
|
@@ -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
|
|
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
class Ishapi::My::GalleriesController < Ishapi::My::MyController
|
3
|
+
|
4
|
+
## expects params[:jwt_token]
|
5
|
+
def index
|
6
|
+
authorize! :my_index, Gallery
|
7
|
+
@galleries = @current_user.profile.galleries.unscoped.where( is_trash: false ).order_by( created_at: :desc ).limit(20)
|
8
|
+
render 'ishapi/galleries/index'
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
|
@@ -4,15 +4,18 @@ module Ishapi
|
|
4
4
|
class MyController < Ishapi::ApplicationController
|
5
5
|
|
6
6
|
# before_action :set_profile # this is DoS on FB - disabled
|
7
|
-
before_action :do_login
|
7
|
+
# before_action :do_login
|
8
|
+
before_action :check_profile
|
9
|
+
|
10
|
+
def account
|
11
|
+
@profile = current_user.profile
|
12
|
+
authorize! :show, @profile
|
13
|
+
end
|
8
14
|
|
9
15
|
private
|
10
16
|
|
11
17
|
def do_login
|
12
|
-
puts! params, 'params'
|
13
|
-
|
14
18
|
token = decode(params[:jwtToken])
|
15
|
-
puts! token, 'token'
|
16
19
|
@current_user = User.find(token["user_id"])
|
17
20
|
end
|
18
21
|
|
@@ -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
|
@@ -3,7 +3,6 @@ class Ishapi::Ability
|
|
3
3
|
include ::CanCan::Ability
|
4
4
|
|
5
5
|
def initialize user
|
6
|
-
|
7
6
|
#
|
8
7
|
# signed in user
|
9
8
|
#
|
@@ -13,15 +12,18 @@ class Ishapi::Ability
|
|
13
12
|
can :manage, :all
|
14
13
|
end
|
15
14
|
|
15
|
+
can [ :update ], ::CoTailors::Address do |address|
|
16
|
+
puts [ user.inspect, address.inspect ], '+++ user in cancancan'
|
17
|
+
true
|
18
|
+
end
|
19
|
+
|
20
|
+
can [ :my_index ], Gallery
|
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
|
#
|
@@ -11,7 +11,7 @@ json.array! @galleries do |gallery|
|
|
11
11
|
json.subhead gallery.subhead
|
12
12
|
json.username gallery.user_profile.name
|
13
13
|
json.cityname gallery.city.name if gallery.city
|
14
|
-
json.
|
14
|
+
json.tag_names gallery.tags.map &:name_seo
|
15
15
|
json.venuename gallery.venue.name if gallery.venue
|
16
16
|
json.partial! 'ishapi/photos/index', :photos => gallery.photos
|
17
17
|
end
|
@@ -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,6 +1,6 @@
|
|
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
|
|
@@ -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,17 +27,21 @@ 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
|
38
|
-
get
|
39
|
-
|
32
|
+
get 'galleries', to: 'galleries#index'
|
33
|
+
get 'newsitems', to: 'newsitems#index'
|
34
|
+
get 'reports', to: 'reports#index'
|
35
|
+
get 'videos', to: 'videos#index'
|
36
|
+
post 'videos', to: 'videos#index'
|
40
37
|
end
|
41
38
|
|
39
|
+
post 'do_purchase', to: 'gameui#do_purchase' # @TODO: rename to just purchase, or destroy endpoint
|
42
40
|
post 'payments', :to => 'payments#create'
|
41
|
+
post 'payments2', :to => 'payments#create2' # @TODO: change
|
42
|
+
get 'payments2', to: 'payments#create2'
|
43
|
+
post 'payments/unlock', to: 'payments#unlock' # do_purchase
|
44
|
+
post 'stripe_confirm', to: 'payments#stripe_confirm' # @TODO: test-drive
|
43
45
|
|
44
46
|
get 'profiles/view/:username', :to => 'user_profiles#show'
|
45
47
|
|
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.138
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-02 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
|
@@ -205,6 +204,7 @@ files:
|
|
205
204
|
- app/controllers/ishapi/invoices_controller.rb
|
206
205
|
- app/controllers/ishapi/maps_controller.rb
|
207
206
|
- app/controllers/ishapi/measurements_controller.rb
|
207
|
+
- app/controllers/ishapi/my/galleries_controller.rb
|
208
208
|
- app/controllers/ishapi/my/my_controller.rb
|
209
209
|
- app/controllers/ishapi/my/reports_controller.rb
|
210
210
|
- app/controllers/ishapi/my/videos_controller.rb
|
@@ -249,6 +249,7 @@ files:
|
|
249
249
|
- app/views/ishapi/maps/index.jbuilder
|
250
250
|
- app/views/ishapi/maps/show.jbuilder
|
251
251
|
- app/views/ishapi/measurements/_show.jbuilder
|
252
|
+
- app/views/ishapi/my/my/account.jbuilder
|
252
253
|
- app/views/ishapi/my/videos/index.jbuilder
|
253
254
|
- app/views/ishapi/newsitems/_index.jbuilder
|
254
255
|
- app/views/ishapi/newsitems/index.jbuilder
|
@@ -265,7 +266,6 @@ files:
|
|
265
266
|
- app/views/ishapi/tags/_widget.jbuilder
|
266
267
|
- app/views/ishapi/tags/index.jbuilder
|
267
268
|
- app/views/ishapi/tags/show.jbuilder
|
268
|
-
- app/views/ishapi/user_profiles/my.jbuilder
|
269
269
|
- app/views/ishapi/user_profiles/show.jbuilder
|
270
270
|
- app/views/ishapi/users/_index.jbuilder
|
271
271
|
- app/views/ishapi/users/show.jbuilder
|
@@ -284,7 +284,7 @@ homepage: http://wasya.co
|
|
284
284
|
licenses:
|
285
285
|
- MIT
|
286
286
|
metadata: {}
|
287
|
-
post_install_message:
|
287
|
+
post_install_message:
|
288
288
|
rdoc_options: []
|
289
289
|
require_paths:
|
290
290
|
- lib
|
@@ -300,7 +300,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
300
300
|
version: '0'
|
301
301
|
requirements: []
|
302
302
|
rubygems_version: 3.0.6
|
303
|
-
signing_key:
|
303
|
+
signing_key:
|
304
304
|
specification_version: 4
|
305
305
|
summary: Summary of Ishapi.
|
306
306
|
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
|