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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5d05f29f2c2248e33c8ee228dc191914f6aa66174505f5ddd3612987258c23a8
|
|
4
|
+
data.tar.gz: 1734e423d697dacab4cdfcf67bee287d43c48b6c5c40d38f229a1e2536ba5032
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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 |
|
data/lib/purchasekit/events.rb
CHANGED
|
@@ -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(
|
|
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(
|
|
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?
|
data/lib/purchasekit/version.rb
CHANGED