shopify-gold 3.1.1 → 3.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/app/assets/javascripts/gold/billing.js +14 -0
- data/app/controllers/gold/application_controller.rb +2 -0
- data/app/views/gold/billing/outstanding_charge.html.erb +3 -1
- data/app/views/layouts/gold/billing.html.erb +20 -0
- data/db/migrate/01_create_gold_billing.rb +1 -0
- data/lib/gold/configuration.rb +5 -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: 2e991f369eefa6ba3d1d16b0e813c66198a3f0e5917ffb12e0b67b579a2f83fd
|
4
|
+
data.tar.gz: 4ef62f22ca0ba627622e19fd28877efac6313d3d6ba2efff315b1186c0cba9b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dcd354fbd85a74c4173421a6ce853e6e990a79b7d8a7311b0548a8f02533cf21e6180e71bb5a70af266a49f03c3fdf89bfc06514f5f2219ded53409c6720fc1
|
7
|
+
data.tar.gz: 1fd08c18c9f15b3eb210b831a66bce5a797475c78edea25795da4a79d42a90807f4b67251954c93ffd2f9b6ad071ef12ea8d99ef48dd5c952d14fa1659be26be
|
data/README.md
CHANGED
@@ -124,6 +124,9 @@ Gold.configure do |config|
|
|
124
124
|
# If Gold is allowed to cancel charges (paid -> free) automatically
|
125
125
|
config.allow_automated_charge_cancellation = true
|
126
126
|
|
127
|
+
# Force Gold billing view's to redirect to iframe
|
128
|
+
config.force_embedded_redirect = false
|
129
|
+
|
127
130
|
config.admin_credentials = {
|
128
131
|
user: "admin",
|
129
132
|
password: "password123"
|
@@ -27,4 +27,18 @@ function tierStep($form) {
|
|
27
27
|
|
28
28
|
if ($tierForm) {
|
29
29
|
tierStep($tierForm);
|
30
|
+
}
|
31
|
+
|
32
|
+
// When embedded
|
33
|
+
if (window.self !== window.top) {
|
34
|
+
var $confirmation = document.getElementById('confirmation-button');
|
35
|
+
|
36
|
+
if ($confirmation) {
|
37
|
+
$confirmation.addEventListener('click', function(e) {
|
38
|
+
e.preventDefault();
|
39
|
+
app.dispatch(actions.Redirect.toRemote({
|
40
|
+
url: $confirmation.getAttribute('href')
|
41
|
+
}));
|
42
|
+
});
|
43
|
+
}
|
30
44
|
}
|
@@ -9,4 +9,6 @@
|
|
9
9
|
|
10
10
|
<div style="height: 25px;"></div>
|
11
11
|
|
12
|
-
<a class="Polaris-Button Polaris-Button--primary"
|
12
|
+
<a class="Polaris-Button Polaris-Button--primary"
|
13
|
+
id="confirmation-button"
|
14
|
+
href="<%= @confirmation_url %>">View charges</a>
|
@@ -4,6 +4,26 @@
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
5
5
|
<title><%= Gold.configuration.app_name %></title>
|
6
6
|
|
7
|
+
<% if ShopifyApp.configuration.embedded_app && Gold.configuration.force_embedded_redirect %>
|
8
|
+
<script>
|
9
|
+
if (window.self === window.top) {
|
10
|
+
location.href = "https://<%= billing.shop.shopify_domain %>/admin/apps/<%= ShopifyApp.configuration.api_key %>" + location.pathname;
|
11
|
+
}
|
12
|
+
</script>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<script src="https://unpkg.com/@shopify/app-bridge@1.6.6/umd/index.js"></script>
|
16
|
+
|
17
|
+
<script>
|
18
|
+
var AppBridge = window['app-bridge'];
|
19
|
+
var createApp = AppBridge.default;
|
20
|
+
var app = createApp({
|
21
|
+
apiKey: '<%= ShopifyApp.configuration.api_key %>',
|
22
|
+
shopOrigin: '<%= billing.shop.shopify_domain %>',
|
23
|
+
});
|
24
|
+
var actions = window['app-bridge'].actions;
|
25
|
+
</script>
|
26
|
+
|
7
27
|
<%= stylesheet_link_tag "shopify/polaris" %>
|
8
28
|
<%= stylesheet_link_tag "gold/billing" %>
|
9
29
|
|
data/lib/gold/configuration.rb
CHANGED
@@ -11,7 +11,8 @@ module Gold
|
|
11
11
|
:allow_automated_charge_cancellation,
|
12
12
|
:days_until_delinquent,
|
13
13
|
:days_until_cleanup,
|
14
|
-
:shop_domain_attribute
|
14
|
+
:shop_domain_attribute,
|
15
|
+
:force_embedded_redirect
|
15
16
|
|
16
17
|
# Callbacks
|
17
18
|
attr_accessor :on_terms,
|
@@ -52,6 +53,9 @@ module Gold
|
|
52
53
|
# The URL to a plan comparison page for the app
|
53
54
|
@plan_comparison_url = nil
|
54
55
|
|
56
|
+
# Force Gold billing view's to redirect to iframe
|
57
|
+
@force_embedded_redirect = false
|
58
|
+
|
55
59
|
# Login credential's to Gold's backend
|
56
60
|
@admin_credentials = {
|
57
61
|
user: "admin",
|
data/lib/gold/version.rb
CHANGED