monza 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +5 -0
- data/lib/monza/verification_response.rb +11 -0
- data/lib/monza/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b144535e2ce5230aa5c42f59e55b6a85fdbc75f6
|
4
|
+
data.tar.gz: 9293b3be0030e1eae0d68a7c65e5f830eeb06744
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a63c211b1404f911c7e786b450ed32456d50694bf3adf68e0604f5e34f6b3635478dc497f2aa1b5b6e0cf4a83f158baab785afa143be97561fc591244fd751b3
|
7
|
+
data.tar.gz: 9138a72a7d3a4ebfad98c013bb02062327fa15c80f10c3c7a23d537dc4b7bd28624c84077c05f7aaa71c5dca3f24068fe9410f3075b63be788dd12da5ff1003a
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -41,6 +41,11 @@ You can also pass in `exclude_old_transactions` with value `true` as an option i
|
|
41
41
|
# this checks if latest transaction receipt expiry_date is in today or the future
|
42
42
|
response.is_subscription_active? # => true or false
|
43
43
|
|
44
|
+
# Check if subscription is active
|
45
|
+
# this checks if ANY transaction receipt expiry_date is in today or the future
|
46
|
+
# this is helpful in case the most recent transaction was cancelled but the user still has a previous transaction or subscription that is active
|
47
|
+
response.is_any_subscription_active? # => true or false
|
48
|
+
|
44
49
|
# Check most recent expiry date
|
45
50
|
# ActiveSupport::TimeWithZone
|
46
51
|
response.latest_expiry_date # => Fri, 17 Jun 2016 01:57:28 UTC +00:00
|
@@ -43,6 +43,17 @@ module Monza
|
|
43
43
|
false
|
44
44
|
end
|
45
45
|
end
|
46
|
+
|
47
|
+
def is_any_subscription_active?
|
48
|
+
expires_dates_ms = @latest_receipt_info.map(&:expires_date_ms)
|
49
|
+
latest_expires_date_ms = expires_dates_ms.max
|
50
|
+
|
51
|
+
if latest_expires_date_ms
|
52
|
+
latest_expires_date_ms >= Time.zone.now
|
53
|
+
else
|
54
|
+
false
|
55
|
+
end
|
56
|
+
end
|
46
57
|
|
47
58
|
def latest_expiry_date
|
48
59
|
@latest_receipt_info.last.expires_date_ms if @latest_receipt_info.last
|
data/lib/monza/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: monza
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Garza
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
version: '0'
|
130
130
|
requirements: []
|
131
131
|
rubyforge_project:
|
132
|
-
rubygems_version: 2.
|
132
|
+
rubygems_version: 2.5.2.3
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Validate iTunes In-App purchase receipts, including auto-renewable subscriptions,
|