shopify-gold 2.0.2.pre → 2.0.3.pre
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/assets/stylesheets/gold/billing.sass +15 -1
- data/app/controllers/gold/admin/billing_controller.rb +5 -1
- data/app/operations/gold/apply_tier_op.rb +14 -2
- data/app/operations/gold/select_tier_op.rb +5 -11
- data/app/views/gold/admin/billing/_status.erb +1 -1
- data/lib/gold/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: fd027c06fce384ce66029afeb9aa3f965156802712554d3d48aacc4ee95aaea6
|
|
4
|
+
data.tar.gz: 3ec0621d1c642434307f4a5f0edd31c9285252f8a530e61ce71979087c889180
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 343b67bf6bbc10831595f812cabd99da17c5cdfeed77cf4da7b53618d27c6624737b43f9c645dbba434a687f63ee0c35126fc27196b60b8a44e0b98fa8eacaca
|
|
7
|
+
data.tar.gz: 883b92d46a77ade35dd7722c3c1234056b0d5108d91de232ba4b30d840d9600419b6525ebd066bbdda99765b4f148cd0679e76628a03648ebd8fe7cd0d2e5083
|
|
@@ -11,6 +11,7 @@ body
|
|
|
11
11
|
background-color: white
|
|
12
12
|
position: relative
|
|
13
13
|
overflow: auto
|
|
14
|
+
flex: 1
|
|
14
15
|
|
|
15
16
|
&:before
|
|
16
17
|
content: asset-url('gold/app-logo.svg')
|
|
@@ -32,6 +33,13 @@ body
|
|
|
32
33
|
background-position: 0 40%
|
|
33
34
|
background-size: 700px
|
|
34
35
|
|
|
36
|
+
@media (max-width: 1200px)
|
|
37
|
+
width: 25%
|
|
38
|
+
background-position: 25% 40%
|
|
39
|
+
|
|
40
|
+
@media (max-width: 900px)
|
|
41
|
+
display: none
|
|
42
|
+
|
|
35
43
|
.tiers
|
|
36
44
|
.tier
|
|
37
45
|
border-top: 1px solid #DFE3E8
|
|
@@ -59,6 +67,12 @@ body
|
|
|
59
67
|
align-items: center
|
|
60
68
|
justify-content: space-between
|
|
61
69
|
width: 100%
|
|
70
|
+
flex-wrap: wrap
|
|
62
71
|
|
|
63
72
|
.tier-description
|
|
64
|
-
max-width:
|
|
73
|
+
max-width: 250px
|
|
74
|
+
|
|
75
|
+
@media (max-width: 800px)
|
|
76
|
+
width: 100%
|
|
77
|
+
max-width: none
|
|
78
|
+
margin-top: 10px
|
|
@@ -102,7 +102,11 @@ module Gold
|
|
|
102
102
|
# Unsuspend a shop
|
|
103
103
|
def unsuspend
|
|
104
104
|
UnsuspendOp.new(billing).call
|
|
105
|
-
|
|
105
|
+
outcome = CheckChargeOp.new(billing).call
|
|
106
|
+
|
|
107
|
+
Gold::ChargeOp.new(billing, process_charge_url).call unless outcome.ok?
|
|
108
|
+
|
|
109
|
+
flash[:success] = "Account unsuspended, charge is '#{outcome}'"
|
|
106
110
|
go_back
|
|
107
111
|
end
|
|
108
112
|
|
|
@@ -18,7 +18,7 @@ module Gold
|
|
|
18
18
|
unless %i[apply_tier apply_free_tier].include?(@billing.current_state)
|
|
19
19
|
if tier.free?
|
|
20
20
|
@billing.transition_to!(:apply_free_tier, tier_id: tier.id)
|
|
21
|
-
|
|
21
|
+
elsif @billing.shopify_plan.paying?
|
|
22
22
|
@billing.transition_to!(:apply_tier, tier_id: tier.id)
|
|
23
23
|
end
|
|
24
24
|
end
|
|
@@ -43,9 +43,21 @@ module Gold
|
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
@billing.transition_to!(
|
|
46
|
+
@billing.transition_to!(billing_state)
|
|
47
47
|
Gold.configuration.on_apply_tier&.call(@billing, tier.id)
|
|
48
48
|
TierApplied.new
|
|
49
49
|
end
|
|
50
|
+
|
|
51
|
+
private
|
|
52
|
+
|
|
53
|
+
def billing_state
|
|
54
|
+
if @billing.shopify_plan.affiliate?
|
|
55
|
+
:affiliate
|
|
56
|
+
elsif @billing.shopify_plan.staff?
|
|
57
|
+
:staff
|
|
58
|
+
else
|
|
59
|
+
:billing
|
|
60
|
+
end
|
|
61
|
+
end
|
|
50
62
|
end
|
|
51
63
|
end
|
|
@@ -36,17 +36,11 @@ module Gold
|
|
|
36
36
|
@billing.update(trial_starts_at: Time.current) unless @billing.trial_starts_at
|
|
37
37
|
|
|
38
38
|
# Process the tier selection, creating charges if necessary
|
|
39
|
-
if @billing.shopify_plan.affiliate?
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
elsif @billing.shopify_plan.staff?
|
|
45
|
-
@billing.tier = @tier
|
|
46
|
-
@billing.save!
|
|
47
|
-
@billing.transition_to!(:staff)
|
|
48
|
-
return TierApplied.new
|
|
49
|
-
elsif @tier.free?
|
|
39
|
+
if @billing.shopify_plan.affiliate? ||
|
|
40
|
+
@billing.shopify_plan.staff? ||
|
|
41
|
+
@tier.free?
|
|
42
|
+
|
|
43
|
+
# If the shop doesn't need a charge, apply the tier
|
|
50
44
|
return ApplyTierOp.new(@billing).call
|
|
51
45
|
else
|
|
52
46
|
# A valid charge is necessary before applying the new tier
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<% if billing.current_state.to_s.include?("suspended") %>
|
|
7
7
|
<p>This account is currently <strong>suspended</strong></p>
|
|
8
8
|
<%= form_tag(gold_admin_engine.unsuspend_path(id: billing.id), method: :put) do %>
|
|
9
|
-
<%= submit_tag 'Unsuspend', data: {confirm: "Are you really sure you want to UNSUSPEND this account?"} %>
|
|
9
|
+
<%= submit_tag 'Unsuspend', class: "btn btn-secondary", data: {confirm: "Are you really sure you want to UNSUSPEND this account?"} %>
|
|
10
10
|
<% end %>
|
|
11
11
|
<% else %>
|
|
12
12
|
<p>This account is currently <strong>allowed</strong></p>
|
data/lib/gold/version.rb
CHANGED
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: 2.0.
|
|
4
|
+
version: 2.0.3.pre
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Smith
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2019-08-
|
|
12
|
+
date: 2019-08-13 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|