purchasekit 0.5.0 → 0.6.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 +4 -4
- data/app/helpers/purchase_kit/paywall_helper.rb +4 -2
- data/app/javascript/controllers/purchasekit/paywall_controller.js +4 -3
- data/app/views/purchase_kit/purchases/_intent.html.erb +1 -0
- data/lib/purchasekit/product/demo.rb +2 -1
- data/lib/purchasekit/product/remote.rb +2 -1
- data/lib/purchasekit/product.rb +3 -2
- data/lib/purchasekit/purchase/intent/remote.rb +2 -1
- data/lib/purchasekit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '06259cd19ab57561d46b97026a0330fbd7d47792d84971319e2893b3adc5b8a6'
|
|
4
|
+
data.tar.gz: be841b7642f9663472c5ec047bf144b065485e91c637864afc3430016340990e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 317a861f889c92f94479fc1d540aa671466105b0a494566d36f8b9ec9a59df9f2b95d735eba02d456115cc7157b7a7180f420ab09df8da179a6bdd5747304931
|
|
7
|
+
data.tar.gz: d8f8de0e095619fe87839deb6cedd9b51cf9eabbd3707fcd74cb2de2df41ceea42d09c9997535a827cd66062e597b5a54f2bb670b5810ef6b5231e49e47f9b47
|
|
@@ -52,7 +52,8 @@ module PurchaseKit
|
|
|
52
52
|
data: {
|
|
53
53
|
purchasekit__paywall_target: "planRadio",
|
|
54
54
|
apple_store_product_id: product.apple_product_id,
|
|
55
|
-
google_store_product_id: product.google_product_id
|
|
55
|
+
google_store_product_id: product.google_product_id,
|
|
56
|
+
google_store_base_plan_id: product.google_base_plan_id
|
|
56
57
|
}
|
|
57
58
|
)
|
|
58
59
|
|
|
@@ -69,7 +70,8 @@ module PurchaseKit
|
|
|
69
70
|
data = (options.delete(:data) || {}).merge(
|
|
70
71
|
purchasekit__paywall_target: "price",
|
|
71
72
|
apple_store_product_id: @current_product.apple_product_id,
|
|
72
|
-
google_store_product_id: @current_product.google_product_id
|
|
73
|
+
google_store_product_id: @current_product.google_product_id,
|
|
74
|
+
google_store_base_plan_id: @current_product.google_base_plan_id
|
|
73
75
|
)
|
|
74
76
|
|
|
75
77
|
loading_content = block ? @template.capture(&block) : "Loading..."
|
|
@@ -131,8 +131,8 @@ export default class extends BridgeComponent {
|
|
|
131
131
|
|
|
132
132
|
#setPrices(prices) {
|
|
133
133
|
this.priceTargets.forEach(el => {
|
|
134
|
-
const { appleStoreProductId, googleStoreProductId } = this.#productIds(el)
|
|
135
|
-
const price = prices[appleStoreProductId] || prices[googleStoreProductId]
|
|
134
|
+
const { appleStoreProductId, googleStoreProductId, googleStoreBasePlanId } = this.#productIds(el)
|
|
135
|
+
const price = prices[appleStoreProductId] || prices[googleStoreBasePlanId] || prices[googleStoreProductId]
|
|
136
136
|
|
|
137
137
|
if (price) {
|
|
138
138
|
el.textContent = price
|
|
@@ -145,7 +145,8 @@ export default class extends BridgeComponent {
|
|
|
145
145
|
#productIds(element) {
|
|
146
146
|
return {
|
|
147
147
|
appleStoreProductId: element.dataset.appleStoreProductId,
|
|
148
|
-
googleStoreProductId: element.dataset.googleStoreProductId
|
|
148
|
+
googleStoreProductId: element.dataset.googleStoreProductId,
|
|
149
|
+
googleStoreBasePlanId: element.dataset.googleStoreBasePlanId
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
data-correlation-id="<%= intent.uuid %>"
|
|
3
3
|
data-apple-store-product-id="<%= intent.product.apple_product_id %>"
|
|
4
4
|
data-google-store-product-id="<%= intent.product.google_product_id %>"
|
|
5
|
+
data-google-store-base-plan-id="<%= intent.product.google_base_plan_id %>"
|
|
5
6
|
data-xcode-completion-url="<%= intent.xcode_completion_url %>"
|
|
6
7
|
data-success-path="<%= intent.success_path %>">
|
|
7
8
|
</div>
|
|
@@ -14,7 +14,8 @@ module PurchaseKit
|
|
|
14
14
|
Product.new(
|
|
15
15
|
id: id,
|
|
16
16
|
apple_product_id: product_data[:apple_product_id],
|
|
17
|
-
google_product_id: product_data[:google_product_id]
|
|
17
|
+
google_product_id: product_data[:google_product_id],
|
|
18
|
+
google_base_plan_id: product_data[:google_base_plan_id]
|
|
18
19
|
)
|
|
19
20
|
end
|
|
20
21
|
end
|
|
@@ -12,7 +12,8 @@ module PurchaseKit
|
|
|
12
12
|
Product.new(
|
|
13
13
|
id: response["id"],
|
|
14
14
|
apple_product_id: response["apple_product_id"],
|
|
15
|
-
google_product_id: response["google_product_id"]
|
|
15
|
+
google_product_id: response["google_product_id"],
|
|
16
|
+
google_base_plan_id: response["google_base_plan_id"]
|
|
16
17
|
)
|
|
17
18
|
when 404
|
|
18
19
|
raise PurchaseKit::NotFoundError, "Product not found: #{id}"
|
data/lib/purchasekit/product.rb
CHANGED
|
@@ -11,12 +11,13 @@ module PurchaseKit
|
|
|
11
11
|
# product.google_product_id # => "pro_annual"
|
|
12
12
|
#
|
|
13
13
|
class Product
|
|
14
|
-
attr_reader :id, :apple_product_id, :google_product_id
|
|
14
|
+
attr_reader :id, :apple_product_id, :google_product_id, :google_base_plan_id
|
|
15
15
|
|
|
16
|
-
def initialize(id:, apple_product_id: nil, google_product_id: nil)
|
|
16
|
+
def initialize(id:, apple_product_id: nil, google_product_id: nil, google_base_plan_id: nil)
|
|
17
17
|
@id = id
|
|
18
18
|
@apple_product_id = apple_product_id
|
|
19
19
|
@google_product_id = google_product_id
|
|
20
|
+
@google_base_plan_id = google_base_plan_id
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
# Get the store-specific product ID for a platform.
|
|
@@ -19,7 +19,8 @@ module PurchaseKit
|
|
|
19
19
|
product = Product.new(
|
|
20
20
|
id: product_data["id"],
|
|
21
21
|
apple_product_id: product_data["apple_product_id"],
|
|
22
|
-
google_product_id: product_data["google_product_id"]
|
|
22
|
+
google_product_id: product_data["google_product_id"],
|
|
23
|
+
google_base_plan_id: product_data["google_base_plan_id"]
|
|
23
24
|
)
|
|
24
25
|
new(id: response["id"], uuid: response["uuid"], product: product, success_path: success_path)
|
|
25
26
|
when 402
|
data/lib/purchasekit/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: purchasekit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joe Masilotti
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-03-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|