effective_orders 1.5.5 → 1.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/effective_orders/shipping_address_toggle.js.coffee +1 -1
- data/app/assets/javascripts/effective_orders/stripe_charges.js.coffee +2 -2
- data/app/assets/javascripts/effective_orders/stripe_subscriptions.js.coffee +2 -2
- data/app/models/effective/datatables/orders.rb +9 -3
- data/lib/effective_orders/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75b721d5cabea376b54181ca7287d4e33ac3cdb3
|
4
|
+
data.tar.gz: 5f3601dc3f0b485dcbceef6554f2c262814568f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67bf705408eeef41f9b756737eb74fd900f6cd8c0e6fcab331e963756c74bb3de996fa7fc9794f6ce6e6e5cc68822e3fefae2328f7e31f18d1dfc0ceb3881be5
|
7
|
+
data.tar.gz: eae01bfd78dcdc3407305f6466a68994dd7412060d67a6bddbd60cc82d94dc744142c38fd4f25b4ce1c11e9e948819d10359f02b785a650c36ed199a54daf9a3
|
@@ -1,5 +1,5 @@
|
|
1
1
|
hideShippingAddressFields = (shipping_address) ->
|
2
|
-
shipping_address.hide().find('input,select').
|
2
|
+
shipping_address.hide().find('input,select').removeAttr('required')
|
3
3
|
|
4
4
|
showShippingAddressFields = (shipping_address) ->
|
5
5
|
shipping_address.show().find("input:not([name$='[address2]']),select:not([name$='[state_code]'])").prop('required', true)
|
@@ -3,7 +3,7 @@ stripeCheckoutHandler = (key, form) ->
|
|
3
3
|
key: key
|
4
4
|
token: (token, args) ->
|
5
5
|
if token.error
|
6
|
-
form.find("input[type='submit']").
|
6
|
+
form.find("input[type='submit']").removeAttr('disabled')
|
7
7
|
$('input[data-disable-with]').each -> try $.rails.enableFormElement($(this))
|
8
8
|
|
9
9
|
alert("An error ocurred when contacting Stripe. Your card has not been charged. Please refresh the page and try again. #{token.error.message}")
|
@@ -30,5 +30,5 @@ $(document).on 'click', "#effective-orders-new-charge-form form input[type='subm
|
|
30
30
|
description: obj.data('description')
|
31
31
|
amount: obj.data('amount')
|
32
32
|
closed: ->
|
33
|
-
form.find("input[type='submit']").
|
33
|
+
form.find("input[type='submit']").removeAttr('disabled')
|
34
34
|
$('input[data-disable-with]').each -> try $.rails.enableFormElement($(this))
|
@@ -3,7 +3,7 @@ stripeCheckoutHandler = (key, form) ->
|
|
3
3
|
key: key
|
4
4
|
token: (token, args) ->
|
5
5
|
if token.error
|
6
|
-
form.find("input[type='submit']").
|
6
|
+
form.find("input[type='submit']").removeAttr('disabled')
|
7
7
|
alert("An error ocurred when contacting Stripe. Your card has not been charged. Please refresh the page and try again. #{token.error.message}")
|
8
8
|
else
|
9
9
|
form.find("input[type='submit']").prop('disabled', true)
|
@@ -25,4 +25,4 @@ $(document).on 'click', "#effective-orders-new-subscription-form form input[type
|
|
25
25
|
email: obj.data('user-email')
|
26
26
|
description: plan.text()
|
27
27
|
panelLabel: 'Start Subscription'
|
28
|
-
closed: -> form.find("input[type='submit']").
|
28
|
+
closed: -> form.find("input[type='submit']").removeAttr('disabled')
|
@@ -22,9 +22,9 @@ if defined?(EffectiveDatatables)
|
|
22
22
|
order.purchase_state || 'abandoned'
|
23
23
|
end
|
24
24
|
|
25
|
-
table_column :
|
25
|
+
table_column :items, label: 'Order Items', sortable: false, column: query_items_list do |order|
|
26
26
|
content_tag(:ul) do
|
27
|
-
(order[:
|
27
|
+
(order[:items] || '').split('!!SEP!!').map { |oi| content_tag(:li, oi) }.join.html_safe
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
@@ -45,7 +45,7 @@ if defined?(EffectiveDatatables)
|
|
45
45
|
.group('users.email, orders.id')
|
46
46
|
.select('orders.*, users.email AS email')
|
47
47
|
.select("#{query_total} AS total")
|
48
|
-
.select("
|
48
|
+
.select("#{query_items_list} AS items")
|
49
49
|
.select("#{query_payment_method} AS payment_method")
|
50
50
|
|
51
51
|
if EffectiveOrders.require_billing_address && defined?(EffectiveAddresses)
|
@@ -72,6 +72,10 @@ if defined?(EffectiveDatatables)
|
|
72
72
|
'SUM((order_items.price * order_items.quantity) + (CASE order_items.tax_exempt WHEN true THEN 0 ELSE ((order_items.price * order_items.quantity) * order_items.tax_rate) END))'
|
73
73
|
end
|
74
74
|
|
75
|
+
def query_items_list
|
76
|
+
"string_agg(order_items.title, '!!SEP!!')"
|
77
|
+
end
|
78
|
+
|
75
79
|
def query_payment_method
|
76
80
|
"COALESCE(SUBSTRING(payment FROM 'card: (\\w{1,2})\\n'), SUBSTRING(payment FROM 'action: (\\w+)_postback\\n'))"
|
77
81
|
end
|
@@ -86,6 +90,8 @@ if defined?(EffectiveDatatables)
|
|
86
90
|
then collection.having("#{query_total} = ?", (search_term.gsub(/[^0-9.]/, '').to_f * 100.0).to_i)
|
87
91
|
when 'purchase_state'
|
88
92
|
then search_term == 'abandoned' ? collection.where(purchase_state: nil) : super
|
93
|
+
when 'items'
|
94
|
+
then collection.having("#{query_items_list} ILIKE ?", "%#{search_term}%")
|
89
95
|
when 'payment_method'
|
90
96
|
then collection.having("#{query_payment_method} LIKE ?", "#{search_term}%")
|
91
97
|
else
|
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: 1.5.
|
4
|
+
version: 1.5.7
|
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: 2015-11-
|
11
|
+
date: 2015-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.
|
117
|
+
version: 1.3.6
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.
|
124
|
+
version: 1.3.6
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: effective_obfuscation
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|