shopify-gold 3.1.3 → 3.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/gold/machine.rb +8 -0
- data/app/views/gold/billing/suspended.html.erb +1 -1
- data/lib/gold/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: 42210d4a164b521418955ee1456a30e7c8cd94e1f99e4530473c49cdd444989a
|
4
|
+
data.tar.gz: '08d0b7fcab1307504ae494a91896aaf00ea34cb8e4a250c200b700244dfcb6e9'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a60cd5603dc1809b005b84075620b0149e30065157c690478dea8aba4d7215a381f41071ae1c40b84ba535b076fec9ff900e40c6dc0be2604e53263206006d2
|
7
|
+
data.tar.gz: 0ee122260697a736a18c98fb4e16d848f69135440c941ae76bd9135def3fc7e1fb7f9e1646cd62db69af416f8e6526a0b68355fe1cadcb8b5181defa3a84f5da
|
data/app/models/gold/machine.rb
CHANGED
@@ -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