rhino_project_subscriptions 0.25.0.beta.16 → 0.30.0.alpha.1
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 +4 -14
- data/lib/generators/rhino_subscriptions/install/install_generator.rb +0 -1
- data/lib/rhino_project_subscriptions.rb +1 -17
- data/lib/rhino_subscriptions/engine.rb +1 -1
- data/lib/rhino_subscriptions/version.rb +2 -2
- metadata +14 -12
- data/lib/generators/rhino_subscriptions/install/templates/rhino_subscriptions.rb.tt +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2385d10e206ae6e2c9cfbb70b85d9aae8bac638110826977cd8f659591b4732e
|
4
|
+
data.tar.gz: 220016addcb425e95b49031eeb97245b205b327951f6cd22b192c6dcbe96146d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa43d1f5b92e9a89fe61dcbc01007cd7d33dd06307dfc90928808dd11b9bd9c5e02e3afe3e1f527e462d0a489047c8bd098d7aed9367a13f2e23982aae54aa07
|
7
|
+
data.tar.gz: de53cd8b5f25a7aa495cf90ed17677c7c2e2781ee09fc51b43101a46284fe49190118b185f13ee63fc6d428db579fd21ccc9e93f3ee5470cbc766b6791f86abb
|
@@ -2,24 +2,15 @@
|
|
2
2
|
|
3
3
|
require "stripe"
|
4
4
|
|
5
|
-
::Stripe.api_key = ENV["
|
5
|
+
::Stripe.api_key = ENV["STRIPE_SECRET_KEY"]
|
6
6
|
|
7
7
|
module Rhino
|
8
8
|
class StripeController < Rhino::BaseController
|
9
9
|
include Rhino::Authenticated
|
10
10
|
|
11
11
|
def prices
|
12
|
-
|
13
|
-
|
14
|
-
list = if RhinoSubscriptions.products == :all
|
15
|
-
::Stripe::Price.list({ active: true, limit: 5, expand: ["data.product"] })["data"]
|
16
|
-
else
|
17
|
-
RhinoSubscriptions.products.flat_map do |product|
|
18
|
-
::Stripe::Price.list({ product:, active: true, limit: 5, expand: ["data.product"] })["data"]
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
render json: { prices: list }
|
12
|
+
list = ::Stripe::Price.list({ active: true, limit: 5, expand: ["data.product"] })
|
13
|
+
render json: { prices: list["data"] }
|
23
14
|
end
|
24
15
|
|
25
16
|
def create_checkout_session
|
@@ -89,8 +80,7 @@ module Rhino
|
|
89
80
|
quantity: 1,
|
90
81
|
price: args["price"]
|
91
82
|
}],
|
92
|
-
customer: customer_id
|
93
|
-
payment_method_collection: RhinoSubscriptions.payment_method_collection
|
83
|
+
customer: customer_id
|
94
84
|
)
|
95
85
|
end
|
96
86
|
|
@@ -4,21 +4,5 @@ require "rhino_subscriptions/engine"
|
|
4
4
|
# require 'active_support'
|
5
5
|
|
6
6
|
module RhinoSubscriptions
|
7
|
-
#
|
8
|
-
mattr_accessor :products, default: :all
|
9
|
-
|
10
|
-
mattr_accessor :payment_method_collection, default: :always
|
11
|
-
|
12
|
-
def self.products=(products)
|
13
|
-
@@products = Array.wrap(products)
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.payment_method_collection=(payment_method_collection)
|
17
|
-
@@payment_method_collection = payment_method_collection
|
18
|
-
end
|
19
|
-
|
20
|
-
# Default way to set up Rhino Subscriptions
|
21
|
-
def self.setup
|
22
|
-
yield self
|
23
|
-
end
|
7
|
+
# Your code goes here...
|
24
8
|
end
|
@@ -13,7 +13,7 @@ module RhinoSubscriptions
|
|
13
13
|
|
14
14
|
initializer "rhino_subscriptions.register_module" do
|
15
15
|
config.after_initialize do
|
16
|
-
if ENV["
|
16
|
+
if ENV["STRIPE_SECRET_KEY"]
|
17
17
|
Rhino.registered_modules[:rhino_subscriptions] = {
|
18
18
|
version: RhinoSubscriptions::VERSION::STRING
|
19
19
|
}
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rhino_project_subscriptions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.30.0.alpha.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Rosevear
|
8
|
+
autorequire:
|
8
9
|
bindir: bin
|
9
10
|
cert_chain: []
|
10
|
-
date:
|
11
|
+
date: 2024-12-08 00:00:00.000000000 Z
|
11
12
|
dependencies:
|
12
13
|
- !ruby/object:Gem::Dependency
|
13
14
|
name: rails
|
@@ -15,48 +16,48 @@ dependencies:
|
|
15
16
|
requirements:
|
16
17
|
- - "~>"
|
17
18
|
- !ruby/object:Gem::Version
|
18
|
-
version:
|
19
|
+
version: 7.2.0
|
19
20
|
- - ">="
|
20
21
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
22
|
+
version: 7.2.0
|
22
23
|
type: :runtime
|
23
24
|
prerelease: false
|
24
25
|
version_requirements: !ruby/object:Gem::Requirement
|
25
26
|
requirements:
|
26
27
|
- - "~>"
|
27
28
|
- !ruby/object:Gem::Version
|
28
|
-
version:
|
29
|
+
version: 7.2.0
|
29
30
|
- - ">="
|
30
31
|
- !ruby/object:Gem::Version
|
31
|
-
version:
|
32
|
+
version: 7.2.0
|
32
33
|
- !ruby/object:Gem::Dependency
|
33
34
|
name: rhino_project_core
|
34
35
|
requirement: !ruby/object:Gem::Requirement
|
35
36
|
requirements:
|
36
37
|
- - '='
|
37
38
|
- !ruby/object:Gem::Version
|
38
|
-
version: 0.
|
39
|
+
version: 0.30.0.alpha.1
|
39
40
|
type: :runtime
|
40
41
|
prerelease: false
|
41
42
|
version_requirements: !ruby/object:Gem::Requirement
|
42
43
|
requirements:
|
43
44
|
- - '='
|
44
45
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.
|
46
|
+
version: 0.30.0.alpha.1
|
46
47
|
- !ruby/object:Gem::Dependency
|
47
48
|
name: stripe
|
48
49
|
requirement: !ruby/object:Gem::Requirement
|
49
50
|
requirements:
|
50
51
|
- - '='
|
51
52
|
- !ruby/object:Gem::Version
|
52
|
-
version:
|
53
|
+
version: 5.28.0
|
53
54
|
type: :runtime
|
54
55
|
prerelease: false
|
55
56
|
version_requirements: !ruby/object:Gem::Requirement
|
56
57
|
requirements:
|
57
58
|
- - '='
|
58
59
|
- !ruby/object:Gem::Version
|
59
|
-
version:
|
60
|
+
version: 5.28.0
|
60
61
|
description: ''
|
61
62
|
email:
|
62
63
|
- jp@codalio.com
|
@@ -76,7 +77,6 @@ files:
|
|
76
77
|
- db/migrate/20210302208003_rhino_create_stripe_customers.rb
|
77
78
|
- db/migrate/20210302299092_rhino_alter_stripe_customers.rb
|
78
79
|
- lib/generators/rhino_subscriptions/install/install_generator.rb
|
79
|
-
- lib/generators/rhino_subscriptions/install/templates/rhino_subscriptions.rb.tt
|
80
80
|
- lib/rhino_project_subscriptions.rb
|
81
81
|
- lib/rhino_subscriptions/engine.rb
|
82
82
|
- lib/rhino_subscriptions/version.rb
|
@@ -85,6 +85,7 @@ homepage: ''
|
|
85
85
|
licenses:
|
86
86
|
- MIT
|
87
87
|
metadata: {}
|
88
|
+
post_install_message:
|
88
89
|
rdoc_options: []
|
89
90
|
require_paths:
|
90
91
|
- lib
|
@@ -99,7 +100,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
100
|
- !ruby/object:Gem::Version
|
100
101
|
version: '0'
|
101
102
|
requirements: []
|
102
|
-
rubygems_version: 3.
|
103
|
+
rubygems_version: 3.5.22
|
104
|
+
signing_key:
|
103
105
|
specification_version: 4
|
104
106
|
summary: ''
|
105
107
|
test_files: []
|
@@ -1,9 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RhinoSubscriptions.setup do |config|
|
4
|
-
# Products to show pricing for
|
5
|
-
# config.products = ["prod_3893aadf", "prod_33aa44adf"]
|
6
|
-
|
7
|
-
# https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-payment_method_collection
|
8
|
-
# config.payment_method_collection = :if_required
|
9
|
-
end
|