ishapi 0.1.8.185 → 0.1.8.187

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f75d6770dc7f44262a3de2a966f74763f1c59ea097b44dd44a7c5f8f3feed540
4
- data.tar.gz: 43a1a061b6dfa79af8721bb168161e81987e002138499678492eccebf20dd572
3
+ metadata.gz: 5b91bea724899fddcf337cc42d851e504a800c2e13dd89fa6089c9c4389e488f
4
+ data.tar.gz: 97329cc032016ef06d074c52630b00a581e0ac01f544049872141184fa731656
5
5
  SHA512:
6
- metadata.gz: ac48c01c6a74af75df4d1073f8f403d96491f597f25549fe021ce51fead139406bc315d0e18d1f3bf5edc4d531b380ca893b111bae51af8f20291cf851f6c556
7
- data.tar.gz: 78a4787442c9911387f4f0a032a635cc0f88407aa0bd82eee0af44a41c15bc368e0598022d795585883d1d27457260725bf09b82400113d57cf1c5ad0285ebf4
6
+ metadata.gz: 884d13540d009af213e8737ec76952c934657f63f71c4a2b5ff257ab633aceb76c0853443869defaa3f0fe24cacc0f67e18f53c7d99e9875de94705145d4a08a
7
+ data.tar.gz: '0148e6510d6afcc9b54201482dcc09b815076ff78bad90230debfff9a2570df29f37ead0586cd5c0ee5c638c10390134a9105203036b6c4052af983869b7dfe6'
@@ -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 }
@@ -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.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-01 00:00:00.000000000 Z
11
+ date: 2022-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails