purchasekit 0.7.1 → 0.8.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82311c2fb6a6a3aea1ffe6997cfece956e4aef5544fa2ef3cb5e4fcb5a8266d8
4
- data.tar.gz: aa2785f59d913cade15b3bd0c1335326279673c0a9e519af90fdc22d9de37e90
3
+ metadata.gz: 5d05f29f2c2248e33c8ee228dc191914f6aa66174505f5ddd3612987258c23a8
4
+ data.tar.gz: 1734e423d697dacab4cdfcf67bee287d43c48b6c5c40d38f229a1e2536ba5032
5
5
  SHA512:
6
- metadata.gz: 752531ead05262da654b7069194df36af97cc4c9dd7fa2c496d230bf637e356ba4aebc97b1d02e44bccd37b34836fcaf432929c7fe46041bb518002979738d0c
7
- data.tar.gz: 131b2ecb97d17134ff6ecea92162422bf82c9d14e7c938f526ba31c245e47bafdc5d14a394818260598b137e1588aea45981a5dcbe42ee86c6bed25a9d5f5340
6
+ metadata.gz: 6d1226d312912c774fef81504560f1bdbb8ec9be76d260588647494243e6319fa240a04f72e98048d6cd8ccf30f06754be95517c5ab79b2f174dbb839a7aaace
7
+ data.tar.gz: 88aa46c038eb5d35603df2a010fc4443949c8d25fbcdb7f17ecbbaa5e736422d8e8ea82652b0d8950d67245751f3717cd3ec5ba0fd6802756ef00e7b8a6e31e1
data/README.md CHANGED
@@ -113,6 +113,7 @@ end
113
113
  | `event.subscription_id` | Store's subscription ID |
114
114
  | `event.store` | `"apple"` or `"google"` |
115
115
  | `event.store_product_id` | e.g., `"com.example.pro.annual"` |
116
+ | `event.google_base_plan_id` | Google Play base plan ID (e.g., `"annual"`) when using umbrella subscriptions, nil otherwise |
116
117
  | `event.status` | `"active"`, `"canceled"`, `"expired"` |
117
118
  | `event.current_period_start` | Start of billing period |
118
119
  | `event.current_period_end` | End of billing period |
@@ -94,6 +94,13 @@ module PurchaseKit
94
94
  payload[:store_product_id]
95
95
  end
96
96
 
97
+ # The Google Play base plan ID (e.g., "annual", "monthly").
98
+ # Only present when the purchase used Google's umbrella subscription
99
+ # with multiple base plans. Nil for Apple and for flat Google products.
100
+ def google_base_plan_id
101
+ payload[:google_base_plan_id]
102
+ end
103
+
97
104
  # The subscription name you configured in PurchaseKit
98
105
  def subscription_name
99
106
  payload[:subscription_name]
@@ -23,7 +23,10 @@ module PurchaseKit
23
23
  current_period_end: parse_time(event["current_period_end"]),
24
24
  trial_ends_at: parse_time(event["trial_ends_at"]),
25
25
  ends_at: parse_time(event["ends_at"]),
26
- data: (subscription.data || {}).merge("store" => event["store"])
26
+ data: (subscription.data || {}).merge(
27
+ "store" => event["store"],
28
+ "google_base_plan_id" => event["google_base_plan_id"]
29
+ ).compact
27
30
  )
28
31
 
29
32
  return unless is_new
@@ -22,7 +22,10 @@ module PurchaseKit
22
22
  current_period_end: parse_time(event["current_period_end"]),
23
23
  trial_ends_at: parse_time(event["trial_ends_at"]),
24
24
  ends_at: parse_time(event["ends_at"]),
25
- data: (subscription.data || {}).merge("store" => event["store"])
25
+ data: (subscription.data || {}).merge(
26
+ "store" => event["store"],
27
+ "google_base_plan_id" => event["google_base_plan_id"]
28
+ ).compact
26
29
  )
27
30
 
28
31
  broadcast_redirect(customer, event) if event["success_path"].present?
@@ -1,3 +1,3 @@
1
1
  module PurchaseKit
2
- VERSION = "0.7.1"
2
+ VERSION = "0.8.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: purchasekit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Masilotti