shopify-gold 3.0.1 → 3.1.0
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 +1 -1
- data/app/controllers/gold/billing_controller.rb +16 -2
- 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: a1a04a46085510f9e78a365b0febc70394fae810d130d6ed4fcbc33add97ae7a
|
|
4
|
+
data.tar.gz: f3e0329c1a333700ab7bd44fa85dc34323ff446947d6a73928fbaa0519868afa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e93d381fb0fcfc778334acf3ebbfe6c39a7106510e558afc6ad929ec6c731e5c5cd861cad1cf52acab2460539424b1ef4b2600f7e36fbc1183dbaed940dd12cb
|
|
7
|
+
data.tar.gz: 580b47448d8e229aa0bd63a15f2522771cb5b82a7438aa3630316a9416abdfefc3407ff59962c5306dc74c616eebb3b6b3980ea4fb29148c93a0b5f795ea5adb
|
data/README.md
CHANGED
|
@@ -196,7 +196,7 @@ before_action :confront_mandatory_billing_action
|
|
|
196
196
|
```
|
|
197
197
|
|
|
198
198
|
You can override any view file by matching Gold's path pattern under `views`. The
|
|
199
|
-
most notable are likely
|
|
199
|
+
most notable are likely `views/gold/billing/terms.html` and `views/gold/billing/tier.html`
|
|
200
200
|
|
|
201
201
|
## Admin interface
|
|
202
202
|
Gold can manage billing for each shop through an admin interface. First, you'll
|
|
@@ -71,6 +71,7 @@ module Gold
|
|
|
71
71
|
when PendingCharge
|
|
72
72
|
Gold.logger.info("[#{billing.id}] Charge is pending")
|
|
73
73
|
@confirmation_url = outcome.confirmation_url
|
|
74
|
+
# Will render view with confirmation URL
|
|
74
75
|
when AcceptedCharge
|
|
75
76
|
Gold.logger.info("[#{billing.id}] Charge is accepted")
|
|
76
77
|
redirect_to outcome.return_url
|
|
@@ -105,7 +106,7 @@ module Gold
|
|
|
105
106
|
case outcome
|
|
106
107
|
when ActiveCharge
|
|
107
108
|
ApplyTierOp.new(billing).call
|
|
108
|
-
|
|
109
|
+
outer_redirect_to_main
|
|
109
110
|
when DeclinedCharge
|
|
110
111
|
redirect_to declined_charge_url
|
|
111
112
|
when ExpiredCharge
|
|
@@ -156,6 +157,19 @@ module Gold
|
|
|
156
157
|
|
|
157
158
|
private
|
|
158
159
|
|
|
160
|
+
# If embedded app, redirect directly through the Shopify admin. This can provide
|
|
161
|
+
# a better experience than the page rendering and JS kicking off a redirect
|
|
162
|
+
def outer_redirect_to_main
|
|
163
|
+
if ShopifyApp.configuration.embedded_app
|
|
164
|
+
shopify_domain = billing.shop.shopify_domain
|
|
165
|
+
api_key = ShopifyApp.configuration.api_key
|
|
166
|
+
fullpath = "/admin/apps/#{api_key}#{main_app.root_path}"
|
|
167
|
+
redirect_to URI::HTTPS.build(host: shopify_domain, path: fullpath).to_s
|
|
168
|
+
else
|
|
169
|
+
redirect_to main_app.root_url
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
159
173
|
# Redirect to the appropriate location based on the return value from
|
|
160
174
|
# ChargeOp.
|
|
161
175
|
def handle_charge_outcome(outcome)
|
|
@@ -173,7 +187,7 @@ module Gold
|
|
|
173
187
|
redirect_to outcome.return_url
|
|
174
188
|
when PendingCharge
|
|
175
189
|
Gold.logger.info("[#{billing.id}] Charge is pending")
|
|
176
|
-
|
|
190
|
+
fullpage_redirect_to outcome.confirmation_url
|
|
177
191
|
end
|
|
178
192
|
end
|
|
179
193
|
|
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: 3.0
|
|
4
|
+
version: 3.1.0
|
|
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-09-
|
|
12
|
+
date: 2019-09-25 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|