monza 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/lib/monza/client.rb +5 -2
- data/lib/monza/config.rb +11 -0
- data/lib/monza/receipt.rb +1 -0
- data/lib/monza/transaction_receipt.rb +3 -4
- data/lib/monza/verification_response.rb +1 -3
- data/lib/monza/version.rb +1 -1
- data/lib/monza.rb +1 -0
- data/monza.gemspec +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2012503293bf8327597edeaf7b14341575df3a3c
|
4
|
+
data.tar.gz: 1a3b0d44f4f744a995f6a494824d160dfee00c88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d247904bd36ec56fa2dd722010ad84941ece3945da7a51231b58d1b4f837b193fa5d2bd800c133e857a688365dda1c46edf24385489cb9f8e617e17ac9deb252
|
7
|
+
data.tar.gz: 75c7b377efe0215e36f561129f0da561a3409c2bb4583a65aa266f552ae89885d84a8b1e3b865fc3c19a32d54e084a5de3e0f22efddf676039274be025581f8e
|
data/lib/monza/client.rb
CHANGED
@@ -33,9 +33,12 @@ module Monza
|
|
33
33
|
|
34
34
|
case status
|
35
35
|
when 0
|
36
|
-
|
36
|
+
begin
|
37
|
+
return VerificationResponse.new(json_response)
|
38
|
+
rescue
|
39
|
+
nil
|
40
|
+
end
|
37
41
|
else
|
38
|
-
puts status
|
39
42
|
raise VerificationResponse::VerificationError.new(status)
|
40
43
|
end
|
41
44
|
|
data/lib/monza/config.rb
ADDED
data/lib/monza/receipt.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'time'
|
2
|
+
require 'active_support/core_ext/time'
|
2
3
|
|
3
4
|
module Monza
|
4
5
|
class TransactionReceipt
|
@@ -23,7 +24,7 @@ module Monza
|
|
23
24
|
attr_reader :is_trial_period
|
24
25
|
|
25
26
|
def initialize(attributes)
|
26
|
-
@quantity = attributes['quantity']
|
27
|
+
@quantity = attributes['quantity'].to_i
|
27
28
|
@product_id = attributes['product_id']
|
28
29
|
@transaction_id = attributes['transaction_id']
|
29
30
|
@original_transaction_id = attributes['original_transaction_id']
|
@@ -50,7 +51,7 @@ module Monza
|
|
50
51
|
end # end initialize
|
51
52
|
|
52
53
|
#
|
53
|
-
# Depcrecating - don't use these
|
54
|
+
# Depcrecating - don't use these
|
54
55
|
# These will only work if the user never cancels and then resubscribes
|
55
56
|
# The original_transaction_id does not reset after the user resubscribes
|
56
57
|
#
|
@@ -61,8 +62,6 @@ module Monza
|
|
61
62
|
# def is_first_transaction?
|
62
63
|
# @original_transaction_id == @transaction_id
|
63
64
|
# end
|
64
|
-
|
65
|
-
|
66
65
|
end # end class
|
67
66
|
end # end module
|
68
67
|
|
@@ -33,7 +33,7 @@ module Monza
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def latest_expiry_date
|
36
|
-
|
36
|
+
@latest_receipt_info.last.expires_date_ms if @latest_receipt_info.last
|
37
37
|
end
|
38
38
|
|
39
39
|
class VerificationError < StandardError
|
@@ -66,11 +66,9 @@ module Monza
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
end # end VerificationError
|
69
|
-
|
70
69
|
end # class
|
71
70
|
end # module
|
72
71
|
|
73
|
-
|
74
72
|
# Sample JSON Response
|
75
73
|
#
|
76
74
|
# {
|
data/lib/monza/version.rb
CHANGED
data/lib/monza.rb
CHANGED
data/monza.gemspec
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: 0.1.
|
4
|
+
version: 0.1.3
|
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: 2017-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,6 +101,7 @@ files:
|
|
87
101
|
- lib/monza.rb
|
88
102
|
- lib/monza/bool_typecasting.rb
|
89
103
|
- lib/monza/client.rb
|
104
|
+
- lib/monza/config.rb
|
90
105
|
- lib/monza/receipt.rb
|
91
106
|
- lib/monza/transaction_receipt.rb
|
92
107
|
- lib/monza/verification_response.rb
|