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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1378d924f29b6fce219d705924c9f88f219009465c906772ebf3dfa5328880f3
4
- data.tar.gz: cd36541d02356c52e92c2b6e7c270ff7a8ab1e4788370b13baadf8aeaac941ee
3
+ metadata.gz: b498f6ef1ac1fbdec66122b1a9d4758ebd6ea917840563c8f296c9e020c03bdd
4
+ data.tar.gz: c34ede893f8f1a84c2d6f7e71968dddfed09ce1a20e43140156805cf2bf93e39
5
5
  SHA512:
6
- metadata.gz: d4f797285dd32040eded18f83eefcb6cbf96357979f4414cb642aec106bde4d975cc795d191adae410f02215d398bc990e36221be239de672749007d0bca2737
7
- data.tar.gz: 461a379a74f124ff0362486a159ce642c724023ffe81f15c8c7c39bb9965482578258f6d93b46b85924031f189c98d7bce509441c312369cb9552ede3ca88219
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
@@ -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 ----------------------------------------------------------------------
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Waffo
4
4
  module Pancake
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: waffo-pancake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Good First Issue