pay 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pay might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +15 -0
- data/lib/pay/billable.rb +5 -0
- data/lib/pay/version.rb +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: 2bde9d6a59e8bb2433c706309b09737bf46039ebc02f271b99923658ca3c3953
|
4
|
+
data.tar.gz: 0ef88d80eee2e59e4bcf6a52d8754cb602ea0aa54ba0818ac29361ac8cd3e06c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73714b5b94113338beab99427ea82378b0f7de541f414662f15977e3470bc3cd3fe5069276e4fdbacf9617ffd189cd38a5eb6dc5a9d2668daa99eec964eb1936
|
7
|
+
data.tar.gz: 333b4d632b7cd1636928eabd29388542b92839ef6f9e2fedb2bd658536fd2ebc8a40a3ca7c41fb1a3974c2d3b9566f5e74da2a71a2106e36afce01b2ea8a83d9
|
data/README.md
CHANGED
@@ -278,6 +278,21 @@ user = User.find_by(email: 'gob@bluthcompany.co')
|
|
278
278
|
user.subscription(name: 'bananastand+')
|
279
279
|
```
|
280
280
|
|
281
|
+
#### Checking a User's Trial/Subscription Status
|
282
|
+
|
283
|
+
```ruby
|
284
|
+
user = User.find_by(email: 'george.senior@bluthcompany.co')
|
285
|
+
user.on_trial_or_subscribed?
|
286
|
+
```
|
287
|
+
|
288
|
+
The `on_trial_or_subscribed?` method has two optional arguments with default values.
|
289
|
+
|
290
|
+
```ruby
|
291
|
+
def on_trial_or_subscribed?(name: 'default', plan: nil)
|
292
|
+
...
|
293
|
+
end
|
294
|
+
```
|
295
|
+
|
281
296
|
#### Checking a User's Subscription Status
|
282
297
|
|
283
298
|
```ruby
|
data/lib/pay/billable.rb
CHANGED
@@ -76,6 +76,11 @@ module Pay
|
|
76
76
|
subscription.active? && subscription.processor_plan == processor_plan
|
77
77
|
end
|
78
78
|
|
79
|
+
def on_trial_or_subscribed?(name: 'default', processor_plan: nil)
|
80
|
+
on_trial?(name: name, plan: processor_plan) ||
|
81
|
+
subscribed?(name: name, processor_plan: processor_plan)
|
82
|
+
end
|
83
|
+
|
79
84
|
def subscription(name: 'default')
|
80
85
|
subscriptions.for_name(name).last
|
81
86
|
end
|
data/lib/pay/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Charnes
|
@@ -296,7 +296,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
296
296
|
- !ruby/object:Gem::Version
|
297
297
|
version: '0'
|
298
298
|
requirements: []
|
299
|
-
rubygems_version: 3.0.
|
299
|
+
rubygems_version: 3.0.6
|
300
300
|
signing_key:
|
301
301
|
specification_version: 4
|
302
302
|
summary: A Ruby on Rails subscription engine.
|