shopify-gold 5.3.0 → 6.0.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/README.md +0 -3
- data/app/controllers/gold/admin/billing_controller.rb +1 -1
- data/app/jobs/gold/after_authenticate_job.rb +1 -1
- data/app/mailers/gold/billing_mailer.rb +3 -3
- data/app/models/gold/billing.rb +3 -1
- data/app/views/gold/admin/billing/_active_charge.erb +1 -1
- data/app/views/gold/admin/billing/_credit.erb +1 -1
- data/lib/gold/configuration.rb +0 -4
- data/lib/gold/version.rb +1 -1
- data/lib/tasks/gold_tasks.rake +3 -3
- metadata +15 -14
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b682f8f59b0df993ebf70c91b08e0132c1954f50f27f29ff5b6a157bb2ef14e8
|
|
4
|
+
data.tar.gz: 557b87e2c2bfe5ec5c65201c80a1baee3080060ae938dff53a4ef31e9a770bc9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a6a09be3d17dd4506fc6b58134024908247bbc24ae1bcc4b93c4a9fbb5d0dfd18aba7230c2d84e178c0b268056072c80f05ef3babe9a62ff66865ab7306f7c70
|
|
7
|
+
data.tar.gz: bee0d8908af7ec53e8e742e8ae100612df945845a417acfe9b55d3d7f23f5f066863573bdddf2835a4d971560455da5270a1fbcf3f9ec6d092934ba72cb38c86
|
data/README.md
CHANGED
|
@@ -119,9 +119,6 @@ Gold.configure do |config|
|
|
|
119
119
|
# The URL to a plan comparison page for the app
|
|
120
120
|
config.plan_comparison_url = "https://heliumdev.com/pricing"
|
|
121
121
|
|
|
122
|
-
# The API version used by Shopify (https://help.shopify.com/en/api/versioning)
|
|
123
|
-
config.shopify_api_version = "2019-04"
|
|
124
|
-
|
|
125
122
|
# If Gold is allowed to cancel charges (paid -> free) automatically
|
|
126
123
|
config.allow_automated_charge_cancellation = true
|
|
127
124
|
|
|
@@ -5,7 +5,7 @@ module Gold
|
|
|
5
5
|
|
|
6
6
|
# Inform a merchant about their account becoming suspended.
|
|
7
7
|
def suspension(billing)
|
|
8
|
-
billing.
|
|
8
|
+
billing.with_shopify_session do
|
|
9
9
|
@shop = ShopifyAPI::Shop.current
|
|
10
10
|
mail(to: @shop.email,
|
|
11
11
|
subject: "We have suspended your access to #{Gold.configuration.app_name}")
|
|
@@ -14,7 +14,7 @@ module Gold
|
|
|
14
14
|
|
|
15
15
|
# Inform a merchant about their non-payment.
|
|
16
16
|
def delinquent(billing)
|
|
17
|
-
billing.
|
|
17
|
+
billing.with_shopify_session do
|
|
18
18
|
@shop = ShopifyAPI::Shop.current
|
|
19
19
|
mail(to: @shop.email,
|
|
20
20
|
subject: "We need you to approve a charge for " \
|
|
@@ -23,7 +23,7 @@ module Gold
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def affiliate_to_paid(billing, confirmation_url)
|
|
26
|
-
billing.
|
|
26
|
+
billing.with_shopify_session do
|
|
27
27
|
@shop = ShopifyAPI::Shop.current
|
|
28
28
|
@confirmation_url = confirmation_url
|
|
29
29
|
app_name = Gold.configuration.app_name
|
data/app/models/gold/billing.rb
CHANGED
|
@@ -50,6 +50,8 @@ module Gold
|
|
|
50
50
|
association_name: :transitions)
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
+
delegate :with_shopify_session, to: :shop
|
|
54
|
+
|
|
53
55
|
delegate :can_transition_to?,
|
|
54
56
|
:transition_to!,
|
|
55
57
|
:transition_to,
|
|
@@ -112,7 +114,7 @@ module Gold
|
|
|
112
114
|
|
|
113
115
|
Gold.logger.info("Received shop update from '#{shop.shopify_domain}'")
|
|
114
116
|
|
|
115
|
-
|
|
117
|
+
with_shopify_session do
|
|
116
118
|
case current_state
|
|
117
119
|
when :affiliate
|
|
118
120
|
if shopify_plan.paying?
|
data/lib/gold/configuration.rb
CHANGED
|
@@ -7,7 +7,6 @@ module Gold
|
|
|
7
7
|
:plan_comparison_url,
|
|
8
8
|
:logger,
|
|
9
9
|
:admin_credentials,
|
|
10
|
-
:shopify_api_version,
|
|
11
10
|
:allow_automated_charge_cancellation,
|
|
12
11
|
:days_until_delinquent,
|
|
13
12
|
:days_until_cleanup,
|
|
@@ -64,9 +63,6 @@ module Gold
|
|
|
64
63
|
password: "password123"
|
|
65
64
|
}
|
|
66
65
|
|
|
67
|
-
# The API version used by Shopify (https://help.shopify.com/en/api/versioning)
|
|
68
|
-
@shopify_api_version = "2019-04"
|
|
69
|
-
|
|
70
66
|
# If Gold is allowed to cancel charges (paid -> free) automatically
|
|
71
67
|
@allow_automated_charge_cancellation = true
|
|
72
68
|
|
data/lib/gold/version.rb
CHANGED
data/lib/tasks/gold_tasks.rake
CHANGED
|
@@ -51,7 +51,7 @@ namespace :gold do
|
|
|
51
51
|
Gold::Billing.all.each do |billing|
|
|
52
52
|
next unless billing.state_machine.can_transition_to?(:check_charge)
|
|
53
53
|
|
|
54
|
-
billing.
|
|
54
|
+
billing.with_shopify_session do
|
|
55
55
|
outcome = Gold::CheckChargeOp.new(billing).call
|
|
56
56
|
|
|
57
57
|
if outcome.ok?
|
|
@@ -77,7 +77,7 @@ namespace :gold do
|
|
|
77
77
|
Gold::Billing.all.each do |billing|
|
|
78
78
|
next unless billing.state_machine.can_transition_to?(:cleanup)
|
|
79
79
|
|
|
80
|
-
billing.
|
|
80
|
+
billing.with_shopify_session do
|
|
81
81
|
outcome = Gold::CleanupOp.new(billing).call
|
|
82
82
|
puts "Cleanup for shop '#{billing.shop.shopify_domain}': #{outcome}"
|
|
83
83
|
end
|
|
@@ -91,7 +91,7 @@ namespace :gold do
|
|
|
91
91
|
next unless billing.state_machine.can_transition_to?(:marked_as_delinquent)
|
|
92
92
|
end
|
|
93
93
|
|
|
94
|
-
billing.
|
|
94
|
+
billing.with_shopify_session do
|
|
95
95
|
domain = billing.shop.shopify_domain
|
|
96
96
|
|
|
97
97
|
begin
|
metadata
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: shopify-gold
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 6.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Smith
|
|
8
8
|
- Nick Mealey
|
|
9
|
-
autorequire:
|
|
9
|
+
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2021-09-03 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|
|
@@ -43,16 +43,16 @@ dependencies:
|
|
|
43
43
|
name: shopify_app
|
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
|
45
45
|
requirements:
|
|
46
|
-
- - "
|
|
46
|
+
- - ">"
|
|
47
47
|
- !ruby/object:Gem::Version
|
|
48
|
-
version: '
|
|
48
|
+
version: '16'
|
|
49
49
|
type: :runtime
|
|
50
50
|
prerelease: false
|
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
|
52
52
|
requirements:
|
|
53
|
-
- - "
|
|
53
|
+
- - ">"
|
|
54
54
|
- !ruby/object:Gem::Version
|
|
55
|
-
version: '
|
|
55
|
+
version: '16'
|
|
56
56
|
- !ruby/object:Gem::Dependency
|
|
57
57
|
name: statesman
|
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -155,16 +155,16 @@ dependencies:
|
|
|
155
155
|
name: shopify_app
|
|
156
156
|
requirement: !ruby/object:Gem::Requirement
|
|
157
157
|
requirements:
|
|
158
|
-
- - "
|
|
158
|
+
- - ">"
|
|
159
159
|
- !ruby/object:Gem::Version
|
|
160
|
-
version: '
|
|
160
|
+
version: '16'
|
|
161
161
|
type: :development
|
|
162
162
|
prerelease: false
|
|
163
163
|
version_requirements: !ruby/object:Gem::Requirement
|
|
164
164
|
requirements:
|
|
165
|
-
- - "
|
|
165
|
+
- - ">"
|
|
166
166
|
- !ruby/object:Gem::Version
|
|
167
|
-
version: '
|
|
167
|
+
version: '16'
|
|
168
168
|
- !ruby/object:Gem::Dependency
|
|
169
169
|
name: sqlite3
|
|
170
170
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -302,7 +302,7 @@ files:
|
|
|
302
302
|
homepage: https://gitlab.com/helium-development/infrastructure/gold
|
|
303
303
|
licenses: []
|
|
304
304
|
metadata: {}
|
|
305
|
-
post_install_message:
|
|
305
|
+
post_install_message:
|
|
306
306
|
rdoc_options: []
|
|
307
307
|
require_paths:
|
|
308
308
|
- lib
|
|
@@ -317,8 +317,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
317
317
|
- !ruby/object:Gem::Version
|
|
318
318
|
version: '0'
|
|
319
319
|
requirements: []
|
|
320
|
-
|
|
321
|
-
|
|
320
|
+
rubyforge_project:
|
|
321
|
+
rubygems_version: 2.7.8
|
|
322
|
+
signing_key:
|
|
322
323
|
specification_version: 4
|
|
323
324
|
summary: Helium's approach to billing for Shopify apps
|
|
324
325
|
test_files: []
|