ishapi 0.1.8.195 → 0.1.8.196
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/ishapi/payments_controller.rb +8 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cac74ad18c61255a3db45b0192d67c09f2ca7b498f7979d47983709f7a0036d
|
4
|
+
data.tar.gz: a04ddbdf71da020e89a4baf912f5796600ae37a215828cf01fc4538d5b689ff2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8deb4efaf0d7c0fcfebda5a5484048f2bbf75350bf8865f8139eac9ebb42373a9f19f1dd79e5bea1220cdf04c4a4dcc494cb920a533f32da59864548518e1e3
|
7
|
+
data.tar.gz: b6bf703266e85ac946b3af85c3467cf61f6b33e6ea00025b55f6825d1fc9372a29bf8b5ed19a225dc6137e965c8d9e6a8e27427519d259ba333c9ea30e19fc3a
|
@@ -51,7 +51,7 @@ module Ishapi
|
|
51
51
|
##
|
52
52
|
def create2
|
53
53
|
authorize! :create, ::Ish::Payment
|
54
|
-
|
54
|
+
@current_profile.update_attributes({ is_purchasing: true })
|
55
55
|
|
56
56
|
begin
|
57
57
|
amount_cents = params[:amount_cents].to_i # @TODO: change
|
@@ -65,9 +65,9 @@ module Ishapi
|
|
65
65
|
|
66
66
|
payment = Ish::Payment.create!(
|
67
67
|
client_secret: intent.client_secret,
|
68
|
-
email:
|
68
|
+
email: @current_profile.email,
|
69
69
|
payment_intent_id: intent.id,
|
70
|
-
profile_id:
|
70
|
+
profile_id: @current_profile.id,
|
71
71
|
)
|
72
72
|
|
73
73
|
render json: { client_secret: intent.client_secret }
|
@@ -110,18 +110,18 @@ module Ishapi
|
|
110
110
|
authorize! :unlock, ::Ish::Payment
|
111
111
|
item = Object::const_get(params['kind']).find params['id']
|
112
112
|
|
113
|
-
existing = Purchase.where( user_profile: @
|
113
|
+
existing = Purchase.where( user_profile: @current_profile, item: item ).first
|
114
114
|
if existing
|
115
115
|
render status: 200, json: { status: :ok, message: 'already purchased' }
|
116
116
|
return
|
117
117
|
end
|
118
118
|
|
119
|
-
@
|
119
|
+
@current_profile.inc( n_unlocks: -item.premium_tier )
|
120
120
|
|
121
|
-
purchase = ::Gameui::PremiumPurchase.create!( item: item, user_profile: @
|
121
|
+
purchase = ::Gameui::PremiumPurchase.create!( item: item, user_profile: @current_profile, )
|
122
122
|
|
123
|
-
@profile = @
|
124
|
-
render 'ishapi/
|
123
|
+
@profile = @current_profile
|
124
|
+
render 'ishapi/user_profiles/account'
|
125
125
|
end
|
126
126
|
|
127
127
|
end
|