shopify-gold 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/app/controllers/gold/admin/referrals_controller.rb +11 -1
- data/app/controllers/gold/billing_controller.rb +2 -2
- data/app/controllers/gold/referrals_controller.rb +1 -1
- data/app/views/gold/admin/referrals/_delete.erb +3 -0
- data/config/routes.rb +1 -0
- data/lib/gold/version.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ae3534c766c64f75ddc836965f6ed350122bff113449ebd0d6cf36ca3490a10
|
4
|
+
data.tar.gz: e6334c900e2fead3533daf82accdb295a7322e45703b7f7378c17b02d7f310d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6e88dbb63de80478f8ed5c25b645571de75def9f1378b1e8f7729c9a32d2d508223507332441c7687600fc8c26674b993896399046545e5939546f5eb9fdc1a
|
7
|
+
data.tar.gz: 0244c687235812af8951ac46e9bc7e4d1938340984886a3540c0531e579b237d4e62fff74ce7cbbb1310d31955fee1c044d75d6bf2ffd4da50e53670951d64f1
|
data/README.md
CHANGED
@@ -234,6 +234,14 @@ The shop will automatically be pushed through the state machine (new, accepted_t
|
|
234
234
|
Note that the `tier_id` must match a tier setup in Gold. If that shop does not
|
235
235
|
have a charge that matches the tier's price, a new charge will be requested.
|
236
236
|
|
237
|
+
## Referral affiliates
|
238
|
+
Gold supports the ability to track affiliate codes that link back to a shop. A referral can
|
239
|
+
apply a discount to a shop when they sign up with a code. It works by sending merchants to a
|
240
|
+
link like `/referral?code=HELIUM`. They will be redirected to the URL setup in config.
|
241
|
+
|
242
|
+
The admin referral controller provides some basic CRUD operations for managing affiliates, but
|
243
|
+
your app will need to implement the logic for rendering referrals.
|
244
|
+
|
237
245
|
## Contributing
|
238
246
|
|
239
247
|
Run tests with:
|
@@ -257,5 +265,8 @@ To release gem, run `gem release`, which depends on having `gem-release` install
|
|
257
265
|
on your system.
|
258
266
|
|
259
267
|
## Changelog
|
268
|
+
Version 4.0.0
|
269
|
+
- Added referral affiliates
|
270
|
+
|
260
271
|
Version 3.2.0
|
261
272
|
- Removed `force_embedded_redirect` config option
|
@@ -11,7 +11,7 @@ module Gold
|
|
11
11
|
flash[:danger] = "Failed to create, #{message}"
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
redirect_to "#{request.path}/#{referral.id}"
|
15
15
|
end
|
16
16
|
|
17
17
|
def update
|
@@ -27,6 +27,16 @@ module Gold
|
|
27
27
|
redirect_back(fallback_location: "/admin")
|
28
28
|
end
|
29
29
|
|
30
|
+
def delete
|
31
|
+
referral = Referral.find(params[:id])
|
32
|
+
|
33
|
+
referral.destroy!
|
34
|
+
|
35
|
+
flash[:success] = "Poof! Code #{referral.code} no longer exists"
|
36
|
+
|
37
|
+
redirect_to gold_admin_engine.referrals_path
|
38
|
+
end
|
39
|
+
|
30
40
|
private
|
31
41
|
|
32
42
|
def referral_params
|
@@ -43,8 +43,8 @@ module Gold
|
|
43
43
|
billing # Expose the @billing variable to the view
|
44
44
|
|
45
45
|
# Apply a referral tracking. Don't overwrite an existing code
|
46
|
-
if !billing.referral && session[:
|
47
|
-
referral = Gold::Referral.find_by(
|
46
|
+
if !billing.referral && session[:gold_referral_id]
|
47
|
+
referral = Gold::Referral.find_by(id: session[:gold_referral_id])
|
48
48
|
|
49
49
|
if referral
|
50
50
|
billing.referral = referral
|
data/config/routes.rb
CHANGED
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: 4.0.
|
4
|
+
version: 4.0.1
|
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: 2020-01-
|
12
|
+
date: 2020-01-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -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: 11.3.0
|
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: 11.3.0
|
168
168
|
- !ruby/object:Gem::Dependency
|
169
169
|
name: sqlite3
|
170
170
|
requirement: !ruby/object:Gem::Requirement
|
@@ -259,6 +259,7 @@ files:
|
|
259
259
|
- app/views/gold/admin/billing/_tier.erb
|
260
260
|
- app/views/gold/admin/billing/_trial_days.erb
|
261
261
|
- app/views/gold/admin/referrals/_billings.erb
|
262
|
+
- app/views/gold/admin/referrals/_delete.erb
|
262
263
|
- app/views/gold/admin/referrals/_form.erb
|
263
264
|
- app/views/gold/billing/_inner_head.html.erb
|
264
265
|
- app/views/gold/billing/declined_charge.html.erb
|
@@ -314,7 +315,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
314
315
|
- !ruby/object:Gem::Version
|
315
316
|
version: '0'
|
316
317
|
requirements: []
|
317
|
-
rubygems_version: 3.0.
|
318
|
+
rubygems_version: 3.0.3
|
318
319
|
signing_key:
|
319
320
|
specification_version: 4
|
320
321
|
summary: Helium's approach to billing for Shopify apps
|