shopify-gold 3.1.3 → 3.1.4

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: 2e991f369eefa6ba3d1d16b0e813c66198a3f0e5917ffb12e0b67b579a2f83fd
4
- data.tar.gz: 4ef62f22ca0ba627622e19fd28877efac6313d3d6ba2efff315b1186c0cba9b0
3
+ metadata.gz: 42210d4a164b521418955ee1456a30e7c8cd94e1f99e4530473c49cdd444989a
4
+ data.tar.gz: '08d0b7fcab1307504ae494a91896aaf00ea34cb8e4a250c200b700244dfcb6e9'
5
5
  SHA512:
6
- metadata.gz: 2dcd354fbd85a74c4173421a6ce853e6e990a79b7d8a7311b0548a8f02533cf21e6180e71bb5a70af266a49f03c3fdf89bfc06514f5f2219ded53409c6720fc1
7
- data.tar.gz: 1fd08c18c9f15b3eb210b831a66bce5a797475c78edea25795da4a79d42a90807f4b67251954c93ffd2f9b6ad071ef12ea8d99ef48dd5c952d14fa1659be26be
6
+ metadata.gz: 3a60cd5603dc1809b005b84075620b0149e30065157c690478dea8aba4d7215a381f41071ae1c40b84ba535b076fec9ff900e40c6dc0be2604e53263206006d2
7
+ data.tar.gz: 0ee122260697a736a18c98fb4e16d848f69135440c941ae76bd9135def3fc7e1fb7f9e1646cd62db69af416f8e6526a0b68355fe1cadcb8b5181defa3a84f5da
@@ -126,6 +126,12 @@ module Gold
126
126
  test
127
127
  end
128
128
 
129
+ def self.ensure_tier_is_not_free
130
+ test = proc { |billing| !billing.tier&.free? }
131
+ test.define_singleton_method(:to_s) { "Tier is not free" }
132
+ test
133
+ end
134
+
129
135
  # Ensure that a shop has been in a current state for longer than number of days
130
136
  def self.ensure_min_days_in_state(duration_in_days)
131
137
  test = proc { |billing|
@@ -207,6 +213,8 @@ module Gold
207
213
  before_transition to: :auto_upgrade_tier, &require_metadata(:tier_id)
208
214
  transition from: :auto_upgrade_tier, to: :delayed_charge
209
215
  transition from: :apply_discount, to: %i[optional_charge billing apply_discount]
216
+ guard_transition to: :apply_discount, &ensure_tier_is_not_free
217
+
210
218
  transition from: :issue_credit, to: %i[billing marked_as_uninstalled]
211
219
 
212
220
  before_transition to: :change_tier, &require_metadata(:tier_id)
@@ -5,6 +5,6 @@
5
5
  <p>
6
6
  We should have sent you an email about why your store is suspended. Please
7
7
  reach out to our
8
- <a href="mailto:<%= Gold.configuration.contact_email %>">support team</a>
8
+ <a href="mailto:<%= Gold.configuration.contact_email %>" target="_blank">support team</a>
9
9
  so we can work with you on a resolution.
10
10
  </p>
data/lib/gold/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gold
2
- VERSION = "3.1.3".freeze
2
+ VERSION = "3.1.4".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify-gold
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.3
4
+ version: 3.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Smith