caboose-cms 0.7.26 → 0.7.27
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/app/assets/javascripts/caboose/checkout_payment.js +25 -4
- data/app/controllers/caboose/checkout_controller.rb +10 -0
- data/app/controllers/caboose/orders_controller.rb +2 -1
- data/app/views/caboose/checkout/payment.html.erb +2 -0
- data/app/views/caboose/orders/admin_index.html.erb +2 -1
- data/config/routes.rb +1 -0
- data/lib/caboose/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09b8be49da8f98835e23293bd190dc36fe08e7ca
|
4
|
+
data.tar.gz: ea3dc7cf4d1d322ab599d456a9e2e2b687a05748
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61ad49076220e5e907860229e7c93669111592147219fd10c3d8b40c698a31555fca740b00ec5e71a1268e3a58dc97f62a16154df385d7acd32e1f9208a3d7c1
|
7
|
+
data.tar.gz: 6a9bf468065377ca084c7504bc10905810df3215c4ef0dbe0f2739fef1515fced6ccd7725c76358aeeaf298af3f05bba4c806a252925b0bdc95488bc22dba5b9
|
@@ -49,10 +49,31 @@ Caboose.Store.Modules.CheckoutPayment = (function() {
|
|
49
49
|
}
|
50
50
|
}
|
51
51
|
else
|
52
|
-
{
|
53
|
-
|
54
|
-
$('
|
55
|
-
|
52
|
+
{
|
53
|
+
// Verify that the order total is correct before submitting
|
54
|
+
$('#message').html("<p class='loading'>Verifying order total...</p>");
|
55
|
+
var total_is_correct = true;
|
56
|
+
$.ajax({
|
57
|
+
url: '/checkout/total',
|
58
|
+
type: 'get',
|
59
|
+
success: function(x) {
|
60
|
+
if (parseFloat(x) != CABOOSE_ORDER_TOTAL)
|
61
|
+
total_is_correct = false;
|
62
|
+
},
|
63
|
+
async: false
|
64
|
+
});
|
65
|
+
|
66
|
+
if (total_is_correct == false)
|
67
|
+
{
|
68
|
+
$('#message').html("<p class='note error'>It looks like the order total has changed since this page has refreshed. Please submit your order again after this page refreshes.");
|
69
|
+
setTimeout(function() { window.location.reload(true); }, 3000);
|
70
|
+
}
|
71
|
+
else
|
72
|
+
{
|
73
|
+
$('#message').html("<p class='loading'>Processing payment...</p>");
|
74
|
+
$('form#payment').submit();
|
75
|
+
$('#checkout-continue button').hide();
|
76
|
+
}
|
56
77
|
}
|
57
78
|
};
|
58
79
|
|
@@ -181,6 +181,16 @@ module Caboose
|
|
181
181
|
end
|
182
182
|
|
183
183
|
#===========================================================================
|
184
|
+
|
185
|
+
# GET /checkout/total
|
186
|
+
def verify_total
|
187
|
+
total = 0.00
|
188
|
+
if logged_in?
|
189
|
+
@order.calculate
|
190
|
+
total = @order.total
|
191
|
+
end
|
192
|
+
render :json => total
|
193
|
+
end
|
184
194
|
|
185
195
|
# GET /checkout/address
|
186
196
|
def address
|
@@ -124,11 +124,13 @@ store_config = @site.store_config
|
|
124
124
|
var SHOW_RELAY = <%= @show_relay ? 'true' : 'false' %>;
|
125
125
|
|
126
126
|
var cart = false;
|
127
|
+
var CABOOSE_ORDER_TOTAL = 0.0;
|
127
128
|
$(document).ready(function() {
|
128
129
|
cart = new Cart({
|
129
130
|
allow_edit_line_items: false,
|
130
131
|
allow_edit_gift_cards: false
|
131
132
|
});
|
133
|
+
CABOOSE_ORDER_TOTAL = <%= Caboose.json(@order.total); %>;
|
132
134
|
});
|
133
135
|
|
134
136
|
</script>
|
@@ -11,7 +11,8 @@
|
|
11
11
|
<a class="caboose-btn" href='/admin/orders/summary-report' target='_blank'>Summary Report</a>
|
12
12
|
</p>
|
13
13
|
<form action='/admin/orders' method='get' id='search_form' style='display: none;'>
|
14
|
-
<p><input type='text' name='id'
|
14
|
+
<p><input type='text' name='id' placeholder='Order ID' value="<%= @pager.params['id'] %>" style='width: 100px;' /></p>
|
15
|
+
<p><input type='text' name='order_number' placeholder='Order Number' value="<%= @pager.params['order_number'] %>" style='width: 100px;' /></p>
|
15
16
|
<p><select name='customer_id'>
|
16
17
|
<optgroup label='Status' style='width: 100px'>
|
17
18
|
<option value=''>-- All customers --</option>
|
data/config/routes.rb
CHANGED
@@ -513,6 +513,7 @@ Caboose::Engine.routes.draw do
|
|
513
513
|
#=============================================================================
|
514
514
|
|
515
515
|
get '/checkout' => 'checkout#index'
|
516
|
+
get '/checkout/total' => 'checkout#verify_total'
|
516
517
|
post '/checkout/attach-user' => 'checkout#attach_user'
|
517
518
|
post '/checkout/attach-guest' => 'checkout#attach_guest'
|
518
519
|
get '/checkout/addresses' => 'checkout#addresses'
|
data/lib/caboose/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.27
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|