effective_orders 4.1.0 → 4.1.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af4efa3c792e1b34f177d52b18445ce7f30be3d5
|
4
|
+
data.tar.gz: 30263da58a648a93672514ad67bdd2b141ca38b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30d73984681fde16edb4bc2656302365075fb4a0786cb81c83f22cb0c150629faec7fb776fc3c0662c5711d7d7831d84c50aadb64bfc4f85797b666506fa352f
|
7
|
+
data.tar.gz: 95d334d4f35d525e4e25de0c1260379895405f3cbe346fe12525fe604989ee095f0a4d9a08a3043f9accda42acdb86e0e62c1d076c8199be48406d067f2f0025
|
@@ -24,8 +24,8 @@ $(document).on 'change keyup', '.effective-orders-subscripter-plan-quantity', (e
|
|
24
24
|
|
25
25
|
quantity = $obj.val() || 0
|
26
26
|
|
27
|
-
# Assign all totals
|
28
27
|
$plan.closest('form').find(".effective-orders-stripe-plan").each ->
|
28
|
+
# Assign all totals
|
29
29
|
plan = $(this)
|
30
30
|
amount = parseInt(plan.data('amount'))
|
31
31
|
interval = plan.data('plan-interval')
|
@@ -37,6 +37,13 @@ $(document).on 'change keyup', '.effective-orders-subscripter-plan-quantity', (e
|
|
37
37
|
|
38
38
|
plan.find('#effective_subscripter_total_amount').text(total)
|
39
39
|
|
40
|
+
# Assign savings if present
|
41
|
+
savings = parseInt(plan.data('savings'))
|
42
|
+
|
43
|
+
if savings > 0
|
44
|
+
total_savings = '$' + ((quantity * savings) / 100.0).toFixed(2)
|
45
|
+
plan.find('.subscripter-total-savings').find('span').text(total_savings)
|
46
|
+
|
40
47
|
# Hijack submit and get a stripe token
|
41
48
|
$(document).on 'click', ".effective-orders-stripe-token-required[type='submit'],[data-choose-stripe-plan-id]", (event) ->
|
42
49
|
$obj = $(event.currentTarget)
|
@@ -45,7 +45,7 @@ module ActsAsSubscribable
|
|
45
45
|
|
46
46
|
def subscripter
|
47
47
|
@_effective_subscripter ||= begin
|
48
|
-
Effective::Subscripter.new(subscribable: self, user: subscribable_buyer, quantity:
|
48
|
+
Effective::Subscripter.new(subscribable: self, user: subscribable_buyer, quantity: subscription&.quantity, stripe_plan_id: subscription&.stripe_plan_id)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_orders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|