waffo-pancake 0.2.0 → 0.2.1
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/CHANGELOG.md +5 -0
- data/lib/waffo/pancake/client.rb +5 -2
- data/lib/waffo/pancake/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b498f6ef1ac1fbdec66122b1a9d4758ebd6ea917840563c8f296c9e020c03bdd
|
|
4
|
+
data.tar.gz: c34ede893f8f1a84c2d6f7e71968dddfed09ce1a20e43140156805cf2bf93e39
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bee472c21659562c0a68275d615eb5af3f21d95ec1937f2aed7fab7a5570b1f968e6b27f3ff4bbd7fa82598eef3e30407b35afbf8503759cca44490aa9e3bb85
|
|
7
|
+
data.tar.gz: f96b92d6942e7a94e298153a02c1f9a5b480afb1c399ba420da5044964bbe7f946ca6d02f09c54086d256f2881485ff250c166536223d7493122fc01b8577926
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
- `Client#subscription_order` also returns the order's current product as `productId`, read
|
|
6
|
+
from `subscriptionProduct { id }`, so a plan change to another product can be detected.
|
|
7
|
+
|
|
3
8
|
## 0.2.0
|
|
4
9
|
|
|
5
10
|
- `Waffo::Pancake.configure` / `.configuration`: process-wide settings that start from the
|
data/lib/waffo/pancake/client.rb
CHANGED
|
@@ -30,6 +30,7 @@ module Waffo
|
|
|
30
30
|
subscriptionOrder(id: $id) {
|
|
31
31
|
id storeId status testMode buyerEmail merchantProvidedBuyerIdentity orderMerchantExternalId
|
|
32
32
|
billingPeriod currentPeriodStart currentPeriodEnd canceledAt
|
|
33
|
+
subscriptionProduct { id }
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
GRAPHQL
|
|
@@ -109,9 +110,11 @@ module Waffo
|
|
|
109
110
|
action("/v1/actions/onetime-order/cancel-order", { order_id: order_id })
|
|
110
111
|
end
|
|
111
112
|
|
|
112
|
-
# Nil when Waffo knows no such order.
|
|
113
|
+
# Nil when Waffo knows no such order. `productId` is the order's current product, so a plan
|
|
114
|
+
# change to another product can be told apart.
|
|
113
115
|
def subscription_order(order_id)
|
|
114
|
-
graphql(SUBSCRIPTION_ORDER_QUERY, id: order_id)&.dig("subscriptionOrder")
|
|
116
|
+
order = graphql(SUBSCRIPTION_ORDER_QUERY, id: order_id)&.dig("subscriptionOrder")
|
|
117
|
+
order && order.merge("productId" => order.dig("subscriptionProduct", "id"))
|
|
115
118
|
end
|
|
116
119
|
|
|
117
120
|
# --- Products ----------------------------------------------------------------------
|