ishapi 0.1.8.183 → 0.1.8.187
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 +4 -0
- data/app/controllers/ishapi/orders_controller.rb +1 -6
- data/app/controllers/ishapi/payments_controller.rb +11 -6
- data/app/views/ishapi/maps/show.jbuilder +7 -7
- data/app/views/ishapi/users/_account.jbuilder +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b91bea724899fddcf337cc42d851e504a800c2e13dd89fa6089c9c4389e488f
|
4
|
+
data.tar.gz: 97329cc032016ef06d074c52630b00a581e0ac01f544049872141184fa731656
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 884d13540d009af213e8737ec76952c934657f63f71c4a2b5ff257ab633aceb76c0853443869defaa3f0fe24cacc0f67e18f53c7d99e9875de94705145d4a08a
|
7
|
+
data.tar.gz: '0148e6510d6afcc9b54201482dcc09b815076ff78bad90230debfff9a2570df29f37ead0586cd5c0ee5c638c10390134a9105203036b6c4052af983869b7dfe6'
|
@@ -34,7 +34,11 @@ class Ishapi::ApplicationController < ActionController::Base
|
|
34
34
|
|
35
35
|
## @TODO: implement completely! _vp_ 2022-08-24
|
36
36
|
def vote
|
37
|
+
|
37
38
|
votee = params[:votee_class_name].constantize.find(params[:votee_id])
|
39
|
+
|
40
|
+
authorize! :open_permission, Ishapi # @TODO: make this more rigid
|
41
|
+
|
38
42
|
out = votee.vote(voter_id: params[:voter_id], value: params[:value].to_sym)
|
39
43
|
|
40
44
|
if out
|
@@ -7,12 +7,7 @@ module Ishapi
|
|
7
7
|
def create
|
8
8
|
authorize! :create, CoTailors::Order
|
9
9
|
|
10
|
-
#
|
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
|
47
|
-
## It's been a while!
|
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 =
|
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 )
|
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,12 +2,12 @@
|
|
2
2
|
# ishapi / maps / show
|
3
3
|
#
|
4
4
|
|
5
|
-
this_key = [
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
]
|
10
|
-
json.cache! this_key do
|
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
11
|
json.map do
|
12
12
|
json.id @map.id.to_s
|
13
13
|
json.slug @map.slug
|
@@ -59,6 +59,6 @@ json.cache! this_key do
|
|
59
59
|
end
|
60
60
|
|
61
61
|
end
|
62
|
-
end
|
62
|
+
# end
|
63
63
|
|
64
64
|
|
@@ -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.
|
4
|
+
version: 0.1.8.187
|
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-
|
11
|
+
date: 2022-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|