compensated 0.1.0.pre10 → 0.1.0.pre11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7353f049b20ed0db094b28209982725fb562a12acf9949e242c3f5a1f0abe2fe
4
- data.tar.gz: 6b5b0b924cdb95c13d1c34588f72ae2646376101c55559e0487e911d238650ef
3
+ metadata.gz: 1454c1dc1fb00eb18f19f349434b8a66ac06d785f48addf22d3e2e301c0902b4
4
+ data.tar.gz: dea5812f96e6dfcba08ae5bf50eb38e85e8cce9c6e858133294c2ac6b9280a11
5
5
  SHA512:
6
- metadata.gz: 41833b7f2b6f404bd7db5608df2efdcf3ad78d834275bddfbfac748a2222ba329dc93d10948f41043944f64fe1b1d2e48a5290198078a675834b1c6928c34376
7
- data.tar.gz: a085a55f3004888325093f863135dc226ae2e3c545c80da9eeb83a24df88c3ab0d3596cae5f9e595eb8310b41e75938adb88785a4e959250422f7cebc1020b4c
6
+ metadata.gz: b364b04efd1219362586d73b30f86dbd067e9ec323ddc027d55248c8781a452e4edadd5279f9f1e1e6dbc018481927521ab9ebc0c7d44229896530829aeb6929
7
+ data.tar.gz: 26d5b42bdd9aa6aee198e4b38300604e261a7c7ec519154025e626ca5a6dacdd356f7e771b42a9ac93c0d3103fb6eac5d90a96d4f386310f89afa9c77c786b6e
data/.gitignore CHANGED
@@ -8,4 +8,7 @@
8
8
  /tmp/
9
9
 
10
10
  # rspec failure tracking
11
- .rspec_status
11
+ .rspec_status
12
+
13
+ # Gems need to work across a variety of versions
14
+ Gemfile.lock
data/compensated.gemspec CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
6
6
  spec.name = "compensated"
7
7
  spec.version = Compensated::VERSION
8
8
  spec.authors = ["Zee"]
9
- spec.email = ["zee@zincma.de"]
9
+ spec.email = ["zee@zinc.coop"]
10
10
 
11
11
  spec.summary = "Provide value (In Ruby!). Get paid."
12
12
  spec.description = "Compensated makes handling transactions slightly less of a nightmare."
@@ -2,7 +2,7 @@ require "compensated/event_parser"
2
2
  module Compensated
3
3
  module AppleIap
4
4
  class EventParser < Compensated::EventParser
5
- SUPPORTED_TYPES = ["INTERACTIVE_RENEWAL", "RENEWAL", "INITIAL_BUY", "DID_CHANGE_RENEWAL_STATUS"]
5
+ SUPPORTED_TYPES = ["CANCEL", "DID_CHANGE_RENEWAL_PREF", "DID_FAIL_TO_RENEW", "DID_RECOVER", "INTERACTIVE_RENEWAL", "RENEWAL", "INITIAL_BUY", "DID_CHANGE_RENEWAL_STATUS"]
6
6
  def parses?(request)
7
7
  return false unless request.data
8
8
  request.data[:notification_type] &&
@@ -36,7 +36,8 @@ module Compensated
36
36
  sku: receipt_data(data)[:product_id],
37
37
  purchased: DateTime.parse(receipt_data(data)[:purchase_date]),
38
38
  expiration: DateTime.parse(receipt_data(data)[:expires_date_formatted]),
39
- },
39
+ cancelled: cancellation_date(data),
40
+ }.compact,
40
41
  ]
41
42
  end
42
43
 
@@ -45,6 +46,13 @@ module Compensated
45
46
  id: receipt_data(data)[:original_transaction_id],
46
47
  }
47
48
  end
49
+
50
+ private
51
+
52
+ def cancellation_date(data)
53
+ return unless receipt_data(data)[:cancellation_date]
54
+ DateTime.parse(receipt_data(data)[:cancellation_date])
55
+ end
48
56
  end
49
57
  end
50
58
  event_parsers.push(AppleIap::EventParser.new)
@@ -1,3 +1,3 @@
1
1
  module Compensated
2
- VERSION = "0.1.0.pre10"
2
+ VERSION = "0.1.0.pre11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compensated
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre10
4
+ version: 0.1.0.pre11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zee
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-19 00:00:00.000000000 Z
11
+ date: 2020-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -68,7 +68,7 @@ dependencies:
68
68
  version: '0'
69
69
  description: Compensated makes handling transactions slightly less of a nightmare.
70
70
  email:
71
- - zee@zincma.de
71
+ - zee@zinc.coop
72
72
  executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
@@ -76,7 +76,6 @@ files:
76
76
  - ".gitignore"
77
77
  - ".rspec"
78
78
  - Gemfile
79
- - Gemfile.lock
80
79
  - LICENSE.md
81
80
  - README.md
82
81
  - Rakefile
data/Gemfile.lock DELETED
@@ -1,37 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- compensated (0.1.0.pre10)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- diff-lcs (1.3)
10
- rack (2.0.7)
11
- rake (10.5.0)
12
- rspec (3.8.0)
13
- rspec-core (~> 3.8.0)
14
- rspec-expectations (~> 3.8.0)
15
- rspec-mocks (~> 3.8.0)
16
- rspec-core (3.8.2)
17
- rspec-support (~> 3.8.0)
18
- rspec-expectations (3.8.4)
19
- diff-lcs (>= 1.2.0, < 2.0)
20
- rspec-support (~> 3.8.0)
21
- rspec-mocks (3.8.1)
22
- diff-lcs (>= 1.2.0, < 2.0)
23
- rspec-support (~> 3.8.0)
24
- rspec-support (3.8.2)
25
-
26
- PLATFORMS
27
- ruby
28
-
29
- DEPENDENCIES
30
- bundler (~> 2.0)
31
- compensated!
32
- rack
33
- rake (~> 10.0)
34
- rspec (~> 3.0)
35
-
36
- BUNDLED WITH
37
- 2.0.2