ishapi 0.1.8.185 → 0.1.8.188

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
  SHA256:
3
- metadata.gz: f75d6770dc7f44262a3de2a966f74763f1c59ea097b44dd44a7c5f8f3feed540
4
- data.tar.gz: 43a1a061b6dfa79af8721bb168161e81987e002138499678492eccebf20dd572
3
+ metadata.gz: 71793ea6c179dcdd89798221461806ee5bcd00ba94e9e5f92ed378b33e473622
4
+ data.tar.gz: fc078c97af8060dba19c745b19a329d05be1e56bd4c831e907aba983316a9442
5
5
  SHA512:
6
- metadata.gz: ac48c01c6a74af75df4d1073f8f403d96491f597f25549fe021ce51fead139406bc315d0e18d1f3bf5edc4d531b380ca893b111bae51af8f20291cf851f6c556
7
- data.tar.gz: 78a4787442c9911387f4f0a032a635cc0f88407aa0bd82eee0af44a41c15bc368e0598022d795585883d1d27457260725bf09b82400113d57cf1c5ad0285ebf4
6
+ metadata.gz: 65a6de0c6777c0bda32fa51ff9e2f222dc06535a5fda670dc428fab3cf8b4d097b963cc11f10c1921203cf8653241d09a145880d94c29b8cd9ce98862e1122ad
7
+ data.tar.gz: b63c594ff9530cce12c6338c1458fb274554f3f0115e3a008c6f6674346bb77847e31593c4d8ff3a623c55ad7289fea2b4e1662774efa175f755cdebe3b456e7
@@ -7,12 +7,7 @@ module Ishapi
7
7
  def create
8
8
  authorize! :create, CoTailors::Order
9
9
 
10
- # byebug
11
- # HEREHERE
12
-
13
- =begin
14
- params = {"token"=>{"id"=>"tok_1BoLkRDpn3WurCccVNQK4pfV", "object"=>"token", "card"=>{"id"=>"card_1BoLkRDpn3WurCccET5cyAMU", "object"=>"card", "address_city"=>nil, "address_country"=>nil, "address_line1"=>nil, "address_line1_check"=>nil, "address_line2"=>nil, "address_state"=>nil, "address_zip"=>"42424", "address_zip_check"=>"unchecked", "brand"=>"Visa", "country"=>"US", "cvc_check"=>"unchecked", "dynamic_last4"=>nil, "exp_month"=>4, "exp_year"=>2024, "funding"=>"credit", "last4"=>"4242", "metadata"=>{}, "name"=>nil, "tokenization_method"=>nil}, "client_ip"=>"76.103.54.198", "created"=>1516929079, "livemode"=>false, "type"=>"card", "used"=>false}, "accessToken"=>"EAAcgM1d2EyABAFAvisZBJy0vnlmunq1RM5rbcfUN0B1G6WGwulGkwqfJyP8Ue8Gb1DsyHyjLZCmEmMKKjhZCFF8JIyyZAGLLyqpIr8kg6wWhAIzLQ7HbYfmwFI8aZARtJB4ZBo4KZBbBx4wHUmLoPqAsG2Ca2DXKPkZD", "order"=>{"token"=>{"id"=>"tok_1BoLkRDpn3WurCccVNQK4pfV", "object"=>"token", "card"=>{"id"=>"card_1BoLkRDpn3WurCccET5cyAMU", "object"=>"card", "address_city"=>nil, "address_country"=>nil, "address_line1"=>nil, "address_line1_check"=>nil, "address_line2"=>nil, "address_state"=>nil, "address_zip"=>"42424", "address_zip_check"=>"unchecked", "brand"=>"Visa", "country"=>"US", "cvc_check"=>"unchecked", "dynamic_last4"=>nil, "exp_month"=>4, "exp_year"=>2024, "funding"=>"credit", "last4"=>"4242", "metadata"=>{}, "name"=>nil, "tokenization_method"=>nil}, "client_ip"=>"76.103.54.198", "created"=>1516929079, "livemode"=>false, "type"=>"card", "used"=>false}, "accessToken"=>"EAAcgM1d2EyABAFAvisZBJy0vnlmunq1RM5rbcfUN0B1G6WGwulGkwqfJyP8Ue8Gb1DsyHyjLZCmEmMKKjhZCFF8JIyyZAGLLyqpIr8kg6wWhAIzLQ7HbYfmwFI8aZARtJB4ZBo4KZBbBx4wHUmLoPqAsG2Ca2DXKPkZD"}}
15
- =end
10
+ # params = {"token"=>{"id"=>"tok_1BoLkRDpn3WurCccVNQK4pfV", "object"=>"token", "card"=>{"id"=>"card_1BoLkRDpn3WurCccET5cyAMU", "object"=>"card", "address_city"=>nil, "address_country"=>nil, "address_line1"=>nil, "address_line1_check"=>nil, "address_line2"=>nil, "address_state"=>nil, "address_zip"=>"42424", "address_zip_check"=>"unchecked", "brand"=>"Visa", "country"=>"US", "cvc_check"=>"unchecked", "dynamic_last4"=>nil, "exp_month"=>4, "exp_year"=>2024, "funding"=>"credit", "last4"=>"4242", "metadata"=>{}, "name"=>nil, "tokenization_method"=>nil}, "client_ip"=>"76.103.54.198", "created"=>1516929079, "livemode"=>false, "type"=>"card", "used"=>false}, "accessToken"=>"EAAcgM1d2EyABAFAvisZBJy0vnlmunq1RM5rbcfUN0B1G6WGwulGkwqfJyP8Ue8Gb1DsyHyjLZCmEmMKKjhZCFF8JIyyZAGLLyqpIr8kg6wWhAIzLQ7HbYfmwFI8aZARtJB4ZBo4KZBbBx4wHUmLoPqAsG2Ca2DXKPkZD", "order"=>{"token"=>{"id"=>"tok_1BoLkRDpn3WurCccVNQK4pfV", "object"=>"token", "card"=>{"id"=>"card_1BoLkRDpn3WurCccET5cyAMU", "object"=>"card", "address_city"=>nil, "address_country"=>nil, "address_line1"=>nil, "address_line1_check"=>nil, "address_line2"=>nil, "address_state"=>nil, "address_zip"=>"42424", "address_zip_check"=>"unchecked", "brand"=>"Visa", "country"=>"US", "cvc_check"=>"unchecked", "dynamic_last4"=>nil, "exp_month"=>4, "exp_year"=>2024, "funding"=>"credit", "last4"=>"4242", "metadata"=>{}, "name"=>nil, "tokenization_method"=>nil}, "client_ip"=>"76.103.54.198", "created"=>1516929079, "livemode"=>false, "type"=>"card", "used"=>false}, "accessToken"=>"EAAcgM1d2EyABAFAvisZBJy0vnlmunq1RM5rbcfUN0B1G6WGwulGkwqfJyP8Ue8Gb1DsyHyjLZCmEmMKKjhZCFF8JIyyZAGLLyqpIr8kg6wWhAIzLQ7HbYfmwFI8aZARtJB4ZBo4KZBbBx4wHUmLoPqAsG2Ca2DXKPkZD"}}
16
11
 
17
12
  @order = CoTailors::Order.where( :profile_id => @current_profile.id, :submitted_at => nil ).first
18
13
  @order.submitted_at = Time.now
@@ -43,14 +43,18 @@ module Ishapi
43
43
  end
44
44
  end
45
45
 
46
- ## This is for guyd _vp_ 2020-07-21
47
- ## It's been a while! _vp_ 2022-03-01
46
+ ## _vp_ 2020-07-21 This is for guyd
47
+ ## _vp_ 2022-03-01 It's been a while!
48
+ ## _vp_ 2022-09-04 continue
49
+ ##
50
+ ## @TODO: cannot proceed if already is_purchasing?
51
+ ##
48
52
  def create2
49
53
  authorize! :create, ::Ish::Payment
50
54
  current_user.profile.update_attributes({ is_purchasing: true })
51
55
 
52
56
  begin
53
- amount_cents = 503 # @TODO: change
57
+ amount_cents = params[:amount_cents].to_i # @TODO: change
54
58
 
55
59
  ::Stripe.api_key = ::STRIPE_SK
56
60
  intent = Stripe::PaymentIntent.create({
@@ -63,7 +67,8 @@ module Ishapi
63
67
  client_secret: intent.client_secret,
64
68
  email: current_user.email,
65
69
  payment_intent_id: intent.id,
66
- profile_id: current_user.profile.id )
70
+ profile_id: current_user.profile.id,
71
+ )
67
72
 
68
73
  render json: { client_secret: intent.client_secret }
69
74
  rescue Mongoid::Errors::DocumentNotFound => e
@@ -93,9 +98,9 @@ module Ishapi
93
98
  if payment && payment_intent['status'] == 'succeeded'
94
99
 
95
100
  payment.update_attributes( status: :confirmed )
96
- n_unlocks = payment.profile.n_unlocks + 5
101
+ n_unlocks = payment.profile.n_unlocks + 1 # @TODO: it's not always 5? adjust
97
102
 
98
- payment.profile.update_attributes!( n_unlocks: n_unlocks, is_purchasing: false ) # @TODO: it's not always 5? adjust
103
+ payment.profile.update_attributes!( n_unlocks: n_unlocks, is_purchasing: false )
99
104
  end
100
105
 
101
106
  render status: 200, json: { status: :ok }
@@ -2,31 +2,60 @@
2
2
  # ishapi / maps / _show
3
3
  #
4
4
 
5
- ## @TODO: make sure that _show.jbuilder and show.jbuilder are reasonably deduped
6
-
7
- this_key = [ map.id, map.updated_at, params.permit! ]
5
+ this_key = [ map.id, map.updated_at ]
8
6
  json.cache! this_key do
7
+
9
8
  json.map do
10
- json.id map.id.to_s
11
- json.slug map.slug
12
- json.parent_slug map.parent_slug
13
- json.description map.description
14
- json.w map.w
15
- json.h map.h
16
- json.img_path map.image.image.url(:original)
17
- json.updated_at map.updated_at
18
- json.rated map.rated
19
-
20
- json.partial! 'ishapi/markers/index', map: map
21
-
22
- ## I removed json parsing from here! _vp_ 2021-10-14
23
- ## I added json parsing here! _vo_ 2021-10-19
24
- if map.parent_slug.present?
25
- json.config JSON.parse @map.parent.config
26
- json.labels JSON.parse @map.parent.labels
9
+ json.id map.id.to_s
10
+ json.slug map.slug
11
+ json.parent_slug map.parent_slug
12
+ json.description map.description
13
+ json.w map.w
14
+ json.h map.h
15
+ json.x map.x
16
+ json.y map.y
17
+ json.map_type map.map_type
18
+ json.img_path map.image.image.url(:original)
19
+ json.updated_at map.updated_at
20
+ json.rated map.rated
21
+ json.name map.name
22
+ json.premium_tier map.premium_tier
23
+ json.is_premium map.is_premium
24
+
25
+ json.breadcrumbs do
26
+ json.array! map.breadcrumbs do |b|
27
+ json.name b[:name]
28
+ json.slug b[:slug]
29
+ json.link b[:link]
30
+ end
31
+ end
32
+
33
+ if markers
34
+ json.partial! 'ishapi/markers/index', markers: markers
35
+ end
36
+
37
+ if newsitems
38
+ json.partial! 'ishapi/newsitems/index', newsitems: newsitems
39
+ end
40
+
41
+ if tags
42
+ json.partial! 'ishapi/tags/index', tags: tags
43
+ end
44
+
45
+ if map.map
46
+ json.partial! 'ishapi/maps/show', map: map.map
47
+ end
48
+
49
+ ## _vp_ 2021-10-14 I removed json parsing from here!
50
+ ## _vp_ 2021-10-19 I added json parsing here!
51
+ ## _vp_ 2022-09-13 Must use my own config, example: 3D -> geodesic. Parent is MapPanelNoZoom, but self is ThreePanelV1
52
+ ## Maybe it's if map_slug is present, rather than parent_slug?
53
+ if map.map_slug.present?
54
+ json.config JSON.parse map.map.config
55
+ json.labels JSON.parse map.map.labels
27
56
  else
28
- json.config JSON.parse @map.config
29
- json.labels JSON.parse @map.labels
57
+ json.config JSON.parse map.config
58
+ json.labels JSON.parse map.labels
30
59
  end
31
60
 
32
61
  end
@@ -0,0 +1,16 @@
1
+
2
+ ##
3
+ ## @deprecated? I've never used this. _vp_ 2022-09-06
4
+ ##
5
+
6
+ json.map do
7
+ json.id map.id.to_s
8
+ json.slug map.slug
9
+ json.parent_slug map.parent_slug
10
+ json.description map.description
11
+ json.w map.w
12
+ json.h map.h
13
+ json.img_path map.image.image.url(:original)
14
+ json.updated_at map.updated_at
15
+ json.rated map.rated
16
+ end
@@ -2,63 +2,5 @@
2
2
  # ishapi / maps / show
3
3
  #
4
4
 
5
- # this_key = [
6
- # @map.id, @map.updated_at,
7
- # current_user&.profile&.updated_at,
8
- # params.permit!
9
- # ]
10
- # json.cache! this_key do
11
- json.map do
12
- json.id @map.id.to_s
13
- json.slug @map.slug
14
- json.parent_slug @map.parent_slug
15
- json.description @map.description
16
- json.w @map.w
17
- json.h @map.h
18
- json.img_path @map.image ? @map.image.image.url(:original) : image_missing
19
- json.updated_at @map.updated_at
20
- json.rated @map.rated
21
-
22
- if @map.is_premium
23
- json.premium_tier @map.premium_tier
24
- json.is_premium @map.premium_tier > 0
25
- json.is_purchased current_user&.profile&.has_premium_purchase( @map )
26
- end
27
-
28
- if @map.map
29
- json.partial! 'ishapi/maps/show', map: @map.map
30
- json.config JSON.parse @map.parent.config
31
- json.labels JSON.parse @map.parent.labels
32
- json.partial! 'ishapi/markers/index', markers: @markers
33
- else
34
- ## I removed json parsing from here! _vp_ 2021-10-14
35
- ## I added json parsing here, and is seems right. _vp_ 2021-10-19
36
- json.config JSON.parse @map.config
37
- json.labels JSON.parse @map.labels
38
- json.partial! 'ishapi/markers/index', markers: @markers
39
- end
40
-
41
- json.breadcrumbs do
42
- json.array! @map.breadcrumbs do |b|
43
- json.name b[:name]
44
- json.slug b[:slug]
45
- json.link b[:link]
46
- end
47
- end
48
-
49
- if @newsitems
50
- json.partial! 'ishapi/newsitems/index', :newsitems => @newsitems
51
- end
52
-
53
- if @galleries
54
- json.partial! 'ishapi/galleries/index', galleries: @galleries
55
- end
56
-
57
- if @tags
58
- json.partial! 'ishapi/tags/index', tags: @tags
59
- end
60
-
61
- end
62
- # end
63
-
5
+ json.partial! 'ishapi/maps/show', map: @map, markers: @markers, newsitems: @newsitems, tags: @tags
64
6
 
@@ -7,7 +7,7 @@ json.profile_photo_url @profile.profile_photo.photo.url( :thumb ) if @profile.pr
7
7
  json.n_reports @profile.reports.count
8
8
  json.n_galleries @profile.galleries.count
9
9
  json.n_videos @profile.videos.count
10
- json.n_stars @profile.n_stars # @TODO: which one is deprecated?
10
+ # json.n_stars @profile.n_stars # @TODO: which one is deprecated?
11
11
  json.n_unlocks @profile.n_unlocks # @TODO: which one is deprecated?
12
12
  json.is_purchasing @profile.is_purchasing
13
13
  if @profile.current_city
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.185
4
+ version: 0.1.8.188
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-01 00:00:00.000000000 Z
11
+ date: 2022-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -323,6 +323,7 @@ files:
323
323
  - app/views/ishapi/mailer/reset_password_instructions.html.erb
324
324
  - app/views/ishapi/mailer/unlock_instructions.html.erb
325
325
  - app/views/ishapi/maps/_show.jbuilder
326
+ - app/views/ishapi/maps/_show_lite.jbuilder-trash
326
327
  - app/views/ishapi/maps/index.jbuilder
327
328
  - app/views/ishapi/maps/show.jbuilder
328
329
  - app/views/ishapi/markers/_index.jbuilder