caboose-cms 0.5.162 → 0.5.163
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/assets/javascripts/caboose/admin_edit_order.js +138 -52
- data/app/assets/javascripts/caboose/checkout_login_register.js +19 -11
- data/app/assets/javascripts/caboose/main.js +17 -0
- data/app/assets/javascripts/caboose/my_account_edit_order.js +490 -0
- data/app/assets/stylesheets/caboose/my_account_edit_order.css.scss +119 -0
- data/app/controllers/caboose/billing_addresses_controller.rb +55 -0
- data/app/controllers/caboose/line_items_controller.rb +10 -2
- data/app/controllers/caboose/my_account_orders_controller.rb +112 -32
- data/app/controllers/caboose/orders_controller.rb +9 -192
- data/app/controllers/caboose/register_controller.rb +9 -8
- data/app/controllers/caboose/shipping_addresses_controller.rb +49 -0
- data/app/models/caboose/authenticator.rb +2 -2
- data/app/models/caboose/order.rb +148 -27
- data/app/views/caboose/line_items/admin_new.html.erb +15 -2
- data/app/views/caboose/my_account_orders/authnet_relay.html.erb +16 -0
- data/app/views/caboose/my_account_orders/authnet_response.html.erb +12 -0
- data/app/views/caboose/my_account_orders/edit.html.erb +53 -111
- data/app/views/caboose/my_account_orders/payment_form.html.erb +138 -0
- data/app/views/caboose/orders/admin_edit.html.erb +3 -0
- data/config/routes.rb +18 -7
- data/lib/caboose/engine.rb +1 -0
- data/lib/caboose/version.rb +1 -1
- metadata +7 -2
@@ -0,0 +1,138 @@
|
|
1
|
+
<%
|
2
|
+
store_config = @site.store_config
|
3
|
+
%>
|
4
|
+
<div id="checkout">
|
5
|
+
<h2>Payment</h2>
|
6
|
+
<section id='checkout-payment'>
|
7
|
+
<% if store_config.pp_name == 'authorize.net' %>
|
8
|
+
<form id="payment" target="relay" action="https://secure.authorize.net/gateway/transact.dll" method="post">
|
9
|
+
<%= sim_fields(@sim_transaction) %>
|
10
|
+
<input type="hidden" id="x_invoice_num" name="x_invoice_num" value="<%= @order.id %>" />
|
11
|
+
<input type="hidden" id="x_description" name="x_after_relay" value="<%= raw store_config.pp_relay_domain %>/checkout/authnet-response/<%= @order.id %>" />
|
12
|
+
<input type="hidden" id="x_first_name" name="x_first_name" value="<%= raw @order.billing_address.first_name %>" />
|
13
|
+
<input type="hidden" id="x_last_name" name="x_last_name" value="<%= raw @order.billing_address.last_name %>" />
|
14
|
+
<input type="hidden" id="x_address" name="x_address" value="<%= raw @order.billing_address.address1 %>" />
|
15
|
+
<input type="hidden" id="x_city" name="x_city" value="<%= raw @order.billing_address.city %>" />
|
16
|
+
<input type="hidden" id="x_state" name="x_state" value="<%= raw @order.billing_address.state %>" />
|
17
|
+
<input type="hidden" id="x_zip" name="x_zip" value="<%= raw @order.billing_address.zip %>" />
|
18
|
+
|
19
|
+
<div class="field" id="credit-card">
|
20
|
+
<span class="field-text">Credit Card</span>
|
21
|
+
<div class="icons">
|
22
|
+
<img src="/assets/caboose/credit_cards.png" alt="Credit Cards Accepted" />
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<div class="field" id="card-number">
|
27
|
+
<span class="field-text">Card</span>
|
28
|
+
<input name="x_card_num" id='billing-cc-number' type="text" maxlength="16" placeholder="Card number" />
|
29
|
+
<div class="icons">
|
30
|
+
<img src="/assets/caboose/lock.png" alt="Secure Connection" />
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<div class="field" id="expiry">
|
35
|
+
<span class="field-text">Expiry</span>
|
36
|
+
<input id="expiration" name="x_exp_date" type="hidden" />
|
37
|
+
<select id="month" name="month">
|
38
|
+
<option value="01">01 - Jan</option>
|
39
|
+
<option value="02">02 - Feb</option>
|
40
|
+
<option value="03">03 - Mar</option>
|
41
|
+
<option value="04">04 - Apr</option>
|
42
|
+
<option value="05">05 - May</option>
|
43
|
+
<option value="06">06 - Jun</option>
|
44
|
+
<option value="07">07 - Jul</option>
|
45
|
+
<option value="08">08 - Aug</option>
|
46
|
+
<option value="09">09 - Sep</option>
|
47
|
+
<option value="10">10 - Oct</option>
|
48
|
+
<option value="11">11 - Nov</option>
|
49
|
+
<option value="12">12 - Dec</option>
|
50
|
+
</select>
|
51
|
+
/
|
52
|
+
<select id="year" name="year">
|
53
|
+
<% (DateTime.now.year...DateTime.now.year + 20).each do |i| %>
|
54
|
+
<option value="<%= i-2000 %>"><%= i %></option>
|
55
|
+
<% end %>
|
56
|
+
</select>
|
57
|
+
</div>
|
58
|
+
|
59
|
+
</form>
|
60
|
+
<% end %>
|
61
|
+
</section>
|
62
|
+
<section id='checkout-confirm'>
|
63
|
+
<% if @order.has_shippable_items? %>
|
64
|
+
<section id='shipping_address'>
|
65
|
+
<h3>Shipping Address</h3>
|
66
|
+
<% sa = @order.shipping_address %>
|
67
|
+
<address>
|
68
|
+
<%= "#{sa.first_name} #{sa.last_name}" %><br />
|
69
|
+
<%= sa.address1 %><br />
|
70
|
+
<%= "#{sa.address2}<br />" if sa.address2 and not sa.address2.empty? %>
|
71
|
+
<%= "#{sa.city}, #{sa.state} #{sa.zip}" %>
|
72
|
+
</address>
|
73
|
+
</section>
|
74
|
+
<% end %>
|
75
|
+
<section id='billing_address'>
|
76
|
+
<h3>Billing Address</h3>
|
77
|
+
<% ba = @order.billing_address %>
|
78
|
+
<address>
|
79
|
+
<%= "#{ba.first_name} #{ba.last_name}" %><br />
|
80
|
+
<%= ba.address1 %><br />
|
81
|
+
<%= "#{ba.address2}<br />" if ba.address2 and not ba.address2.empty? %>
|
82
|
+
<%= "#{ba.city}, #{ba.state} #{ba.zip}" %>
|
83
|
+
</address>
|
84
|
+
</section>
|
85
|
+
<% if @order.has_shippable_items? %>
|
86
|
+
<section id='shipping_method'>
|
87
|
+
<h3>Shipping</h3>
|
88
|
+
<% @order.order_packages.all.each do |op| %>
|
89
|
+
<p><%= op.shipping_method.service_name %> - <%= number_to_currency(op.total) %></p>
|
90
|
+
<% end %>
|
91
|
+
</section>
|
92
|
+
<% end %>
|
93
|
+
<section id='payment_method'>
|
94
|
+
<h3>Payment Method</h3>
|
95
|
+
<div id='confirm_card'>
|
96
|
+
<p id='confirm_card_number'></p>
|
97
|
+
<p><a href="#" id='edit_payment'>Edit</a></p>
|
98
|
+
</div>
|
99
|
+
</section>
|
100
|
+
<div style='clear: left;'> </div>
|
101
|
+
</section>
|
102
|
+
<section>
|
103
|
+
<div id='cart'></div>
|
104
|
+
</section>
|
105
|
+
<section id="checkout-continue">
|
106
|
+
<div id='message'><p align='center'>Your credit card will not be charged until you confirm your order.</p></div>
|
107
|
+
<button class="blue">Continue to Order Confirmation</button>
|
108
|
+
<em>or</em>
|
109
|
+
<a href="/">return to the store</a>
|
110
|
+
</section>
|
111
|
+
<iframe id="relay" name="relay" style='display: block; width: 800px; height: 400px; border: #000 1px solid;'></iframe>
|
112
|
+
</div>
|
113
|
+
|
114
|
+
<%= content_for :caboose_js do %>
|
115
|
+
<%= javascript_include_tag 'caboose/cart' %>
|
116
|
+
<%= javascript_include_tag 'caboose/checkout_payment' %>
|
117
|
+
<script type='text/javascript'>
|
118
|
+
var SHOW_RELAY = <%= @show_relay ? 'true' : 'false' %>;
|
119
|
+
|
120
|
+
var cart = false;
|
121
|
+
$(document).ready(function() {
|
122
|
+
cart = new Cart({
|
123
|
+
allow_edit_line_items: false,
|
124
|
+
allow_edit_gift_cards: false
|
125
|
+
});
|
126
|
+
});
|
127
|
+
|
128
|
+
</script>
|
129
|
+
<% end %>
|
130
|
+
<%= content_for :caboose_css do %>
|
131
|
+
<%= stylesheet_link_tag 'caboose/cart' %>
|
132
|
+
<%= stylesheet_link_tag 'caboose/checkout' %>
|
133
|
+
<style type='text/css'>
|
134
|
+
|
135
|
+
#checkout h3 { font-size: 14pt; font-weight: bold; }
|
136
|
+
|
137
|
+
</style>
|
138
|
+
<% end %>
|
@@ -6,7 +6,9 @@
|
|
6
6
|
<div id='overview_table'></div>
|
7
7
|
<div id='order_table'></div>
|
8
8
|
<div id='message'></div>
|
9
|
+
<div id='controls'></div>
|
9
10
|
|
11
|
+
<!--
|
10
12
|
<p>
|
11
13
|
<input type='button' value='< Back' onclick="window.location='/admin/orders';" />
|
12
14
|
<% if @order.financial_status == Caboose::Order::FINANCIAL_STATUS_AUTHORIZED && @order.total > 0.00 %>
|
@@ -23,6 +25,7 @@
|
|
23
25
|
<% str = Caboose.plugin_hook('admin_edit_order_buttons', "", @order) %>
|
24
26
|
<% if str %><%= raw str %><% end %>
|
25
27
|
</p>
|
28
|
+
-->
|
26
29
|
|
27
30
|
<% content_for :caboose_js do %>
|
28
31
|
<%= javascript_include_tag 'caboose/model/all' %>
|
data/config/routes.rb
CHANGED
@@ -27,12 +27,23 @@ Caboose::Engine.routes.draw do
|
|
27
27
|
#get "my-account" => "users#my_account"
|
28
28
|
#put "my-account" => "users#update_my_account"
|
29
29
|
|
30
|
-
get
|
31
|
-
get
|
32
|
-
get
|
33
|
-
|
34
|
-
get
|
35
|
-
|
30
|
+
get "my-account/orders/:order_id/line-items/:id/download" => "my_account_line_items#download"
|
31
|
+
get "my-account/orders/:order_id/line-items/:id" => "my_account_line_items#edit"
|
32
|
+
get "my-account/orders/:order_id/line-items" => "my_account_line_items#index"
|
33
|
+
|
34
|
+
get "my-account/orders/:order_id/billing-address/json" => "billing_addresses#my_account_json"
|
35
|
+
put "my-account/orders/:order_id/billing-address" => "billing_addresses#my_account_update"
|
36
|
+
get "my-account/orders/:order_id/shipping-address/json" => "shipping_addresses#my_account_json"
|
37
|
+
put "my-account/orders/:order_id/shipping-address" => "shipping_addresses#my_account_update"
|
38
|
+
|
39
|
+
get "my-account/orders/authnet-relay" => "my_account_orders#authnet_relay"
|
40
|
+
post "my-account/orders/authnet-relay" => "my_account_orders#authnet_relay"
|
41
|
+
get "my-account/orders/:id/authnet-response" => "my_account_orders#authnet_response"
|
42
|
+
post "my-account/orders/:id/authnet-response" => "my_account_orders#authnet_response"
|
43
|
+
get "my-account/orders/:id/json" => "my_account_orders#order_json"
|
44
|
+
get "my-account/orders/:id/json" => "my_account_orders#order_json"
|
45
|
+
get "my-account/orders/:id" => "my_account_orders#edit"
|
46
|
+
get "my-account/orders" => "my_account_orders#index"
|
36
47
|
|
37
48
|
get "my-account" => "my_account#index"
|
38
49
|
put "my-account" => "my_account#update"
|
@@ -538,7 +549,7 @@ Caboose::Engine.routes.draw do
|
|
538
549
|
get "admin/orders/:order_id/billing-address/json" => "billing_addresses#admin_json"
|
539
550
|
put "admin/orders/:order_id/billing-address" => "billing_addresses#admin_update"
|
540
551
|
get "admin/orders/:order_id/shipping-address/json" => "shipping_addresses#admin_json"
|
541
|
-
put "admin/orders/:order_id/shipping-address" => "shipping_addresses#admin_update"
|
552
|
+
put "admin/orders/:order_id/shipping-address" => "shipping_addresses#admin_update"
|
542
553
|
|
543
554
|
#=============================================================================
|
544
555
|
# Gift cards
|
data/lib/caboose/engine.rb
CHANGED
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.5.
|
4
|
+
version: 0.5.163
|
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-03-
|
11
|
+
date: 2015-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -452,6 +452,7 @@ files:
|
|
452
452
|
- app/assets/javascripts/caboose/model/model_binder.js
|
453
453
|
- app/assets/javascripts/caboose/model/pager.js
|
454
454
|
- app/assets/javascripts/caboose/model/s3.js
|
455
|
+
- app/assets/javascripts/caboose/my_account_edit_order.js
|
455
456
|
- app/assets/javascripts/caboose/product.js
|
456
457
|
- app/assets/javascripts/caboose/s3upload.js
|
457
458
|
- app/assets/javascripts/caboose/shortcut.js
|
@@ -484,6 +485,7 @@ files:
|
|
484
485
|
- app/assets/stylesheets/caboose/modal.css
|
485
486
|
- app/assets/stylesheets/caboose/model_binder.css
|
486
487
|
- app/assets/stylesheets/caboose/my_account.css
|
488
|
+
- app/assets/stylesheets/caboose/my_account_edit_order.css.scss
|
487
489
|
- app/assets/stylesheets/caboose/page_bar_generator.css
|
488
490
|
- app/assets/stylesheets/caboose/print.css
|
489
491
|
- app/assets/stylesheets/caboose/product_images.css.scss
|
@@ -774,8 +776,11 @@ files:
|
|
774
776
|
- app/views/caboose/login_mailer/forgot_password_email.html.erb
|
775
777
|
- app/views/caboose/modal/index.html.erb
|
776
778
|
- app/views/caboose/my_account/index.html.erb
|
779
|
+
- app/views/caboose/my_account_orders/authnet_relay.html.erb
|
780
|
+
- app/views/caboose/my_account_orders/authnet_response.html.erb
|
777
781
|
- app/views/caboose/my_account_orders/edit.html.erb
|
778
782
|
- app/views/caboose/my_account_orders/index.html.erb
|
783
|
+
- app/views/caboose/my_account_orders/payment_form.html.erb
|
779
784
|
- app/views/caboose/orders/_admin_footer.html.erb
|
780
785
|
- app/views/caboose/orders/_admin_header.html.erb
|
781
786
|
- app/views/caboose/orders/_quickbooks_order.html.erb
|