rhino_project_subscriptions 0.21.0.beta.21 → 0.21.0.beta.23
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/rhino/stripe_controller.rb +12 -0
- data/config/routes.rb +1 -0
- data/lib/rhino_subscriptions/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bba9aea5d1e84bec02c06053c40047a9e81fdf909173b08eccd510ac0f1b278
|
4
|
+
data.tar.gz: 9b2c4bb400e186146931454a9b5a1a8cf1923ac4fd9545382e643e6d560db945
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f594f1036bd59d48632bc9f54e256cd5f622d52f2c83990e580488317480313712a58b527ddf250d740d18598a3e989bf0c378d1e7ba538e4c90831991284787
|
7
|
+
data.tar.gz: 6c9e96c7a2b6818db05a8c05f0e708358038e4717b3d797c13cb66f66f3e2deae7dd09ae6cb817d49d92c629c68cc3a9980c1dc80a5e6850a789a77e8bc9c70d
|
@@ -25,6 +25,18 @@ module Rhino
|
|
25
25
|
}
|
26
26
|
end
|
27
27
|
|
28
|
+
def cancel
|
29
|
+
stripe_customer = Rhino::StripeCustomer.find_by(base_owner_id: params["base_owner_id"])
|
30
|
+
return render json: {} unless stripe_customer
|
31
|
+
|
32
|
+
subscriptions = ::Stripe::Subscription.list({ customer: stripe_customer["customer_id"] })
|
33
|
+
subscriptions.each do |subscription|
|
34
|
+
::Stripe::Subscription.delete(subscription.id)
|
35
|
+
end
|
36
|
+
|
37
|
+
render json: {}
|
38
|
+
end
|
39
|
+
|
28
40
|
def customer
|
29
41
|
stripe_customer = Rhino::StripeCustomer.find_by(base_owner_id: params["base_owner_id"])
|
30
42
|
if stripe_customer
|
data/config/routes.rb
CHANGED
@@ -6,6 +6,7 @@ Rails.application.routes.draw do
|
|
6
6
|
post 'subscription/customer' ,to: 'rhino/stripe#customer'
|
7
7
|
get 'subscription/subscriptions' ,to: 'rhino/stripe#subscriptions'
|
8
8
|
post 'subscription/create-checkout-session' ,to: 'rhino/stripe#create_checkout_session'
|
9
|
+
post 'subscription/cancel' ,to: 'rhino/stripe#cancel'
|
9
10
|
get 'subscription/check_session_id' ,to: 'rhino/stripe#check_session_id'
|
10
11
|
|
11
12
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rhino_project_subscriptions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.21.0.beta.
|
4
|
+
version: 0.21.0.beta.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Rosevear
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - '='
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 0.21.0.beta.
|
39
|
+
version: 0.21.0.beta.23
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - '='
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 0.21.0.beta.
|
46
|
+
version: 0.21.0.beta.23
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: stripe
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|