caboose-cms 0.5.60 → 0.5.61

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +8 -8
  2. data/app/assets/javascripts/caboose/authorize.net.js +187 -0
  3. data/app/assets/javascripts/caboose/cart.js +13 -8
  4. data/app/assets/javascripts/caboose/checkout_step4.js +7 -9
  5. data/app/controllers/caboose/#Untitled-1# +7 -0
  6. data/app/controllers/caboose/application_controller.rb +12 -10
  7. data/app/controllers/caboose/cart_controller.rb +3 -3
  8. data/app/controllers/caboose/checkout_controller.rb +51 -61
  9. data/app/controllers/caboose/orders_controller.rb +1 -0
  10. data/app/mailers/caboose/orders_mailer.rb +4 -2
  11. data/app/models/caboose/authnet.rb +140 -0
  12. data/app/models/caboose/order.rb +6 -0
  13. data/app/models/caboose/payment_processors/authorizenet.rb +18 -23
  14. data/app/models/caboose/schema.rb +3 -1
  15. data/app/models/caboose/site.rb +4 -0
  16. data/app/views/caboose/checkout/#Untitled-2# +41 -0
  17. data/app/views/caboose/checkout/_confirm.html.erb +10 -10
  18. data/app/views/caboose/checkout/authnet_profile_form.html.erb +14 -0
  19. data/app/views/caboose/checkout/authnet_relay.html.erb +16 -0
  20. data/app/views/caboose/checkout/authnet_response.html.erb +12 -0
  21. data/app/views/caboose/checkout/{relay.html.erb → payscape_relay.html.erb} +0 -0
  22. data/app/views/caboose/checkout/step_four.html.erb +36 -35
  23. data/app/views/caboose/checkout/step_four_old.html.erb +63 -0
  24. data/app/views/caboose/checkout/step_two.html.erb +8 -0
  25. data/app/views/caboose/orders/admin_edit.html.erb +14 -6
  26. data/app/views/caboose/orders/admin_index.html.erb +3 -3
  27. data/config/routes.rb +13 -8
  28. data/lib/caboose/version.rb +1 -1
  29. metadata +11 -3
@@ -0,0 +1,63 @@
1
+ <%
2
+ store_config = @site.store_config
3
+ %>
4
+ <div id="checkout">
5
+ <h2>Payment</h2>
6
+ <%= render :partial => 'caboose/checkout/confirm' %>
7
+ <section id="checkout-payment">
8
+ <div class="wrapper">
9
+ <% if store_config.pp_name == 'authorize.net' %>
10
+ <form id="payment" target="relay" action="https://secure.authorize.net/gateway/transact.dll" method="post">
11
+ <%= sim_fields(@sim_transaction) %>
12
+
13
+ <label>Card Number</label>
14
+ <input name="x_card_num" type="text" maxlength="16" />
15
+ <!--<br />
16
+ <label>Security Code</label><br />
17
+ <input id="x_card_code" name="x_card_code" type="text" />-->
18
+ <br />
19
+
20
+ <label>Expiration</label>
21
+ <input id="expiration" name="x_exp_date" type="hidden" />
22
+ <select id="month" name="month">
23
+ <option value="01">01 - Jan</option>
24
+ <option value="02">02 - Feb</option>
25
+ <option value="03">03 - Mar</option>
26
+ <option value="04">04 - Apr</option>
27
+ <option value="05">05 - May</option>
28
+ <option value="06">06 - Jun</option>
29
+ <option value="07">07 - Jul</option>
30
+ <option value="08">08 - Aug</option>
31
+ <option value="09">09 - Sep</option>
32
+ <option value="10">10 - Oct</option>
33
+ <option value="11">11 - Nov</option>
34
+ <option value="12">12 - Dec</option>
35
+ </select>
36
+ /
37
+ <select id="year" name="year">
38
+ <% (DateTime.now.year...DateTime.now.year + 20).each do |i| %>
39
+ <option value="<%= i-2000 %>"><%= i %></option>
40
+ <% end %>
41
+ </select><br />
42
+ <br />
43
+ <input type="submit" value="Submit" />
44
+ </form>
45
+ <iframe id="relay" name="relay" style='display: block; width: 800px; height: 400px; border: #000 1px solid;'></iframe>
46
+ <% end %>
47
+ </div>
48
+ </section>
49
+ <section id="checkout-continue">
50
+ <div id='message'></div>
51
+ <button class="blue">Continue</button>
52
+ <em>or</em>
53
+ <a href="/">return to the store</a>
54
+ </section>
55
+
56
+ </div>
57
+
58
+ <%= content_for :caboose_js do %>
59
+ <%= javascript_include_tag 'caboose/checkout_step4' %>
60
+ <% end %>
61
+ <%= content_for :caboose_css do %>
62
+ <%= stylesheet_link_tag 'caboose/checkout' %>
63
+ <% end %>
@@ -1,6 +1,14 @@
1
1
  <%
2
2
  sa = @order.shipping_address
3
3
  ba = @order.billing_address
4
+ if sa.nil?
5
+ q = ["status <> ? and id < ?", 'cart', @order.id]
6
+ if Caboose::Order.where(q).exists?
7
+ last_order = Caboose::Order.where(q).first
8
+ sa = last_order.shipping_address
9
+ ba = last_order.billing_address
10
+ end
11
+ end
4
12
  %>
5
13
 
6
14
  <div id="checkout">
@@ -13,6 +13,7 @@ captured = @order.financial_status == 'captured'
13
13
  <tr>
14
14
  <th><%= if @order.customer.nil? then 'Guest' else 'Customer' end %></th>
15
15
  <th>Shipping Address</th>
16
+ <th>Shipping Method</th>
16
17
  <th>Order Status</th>
17
18
  <th>Payment Status</th>
18
19
  <th>Transaction ID</th>
@@ -25,22 +26,29 @@ captured = @order.financial_status == 'captured'
25
26
  <% elsif @order.email %>
26
27
  <a href="mailto:<%= @order.email %>"><%= @order.email %></a>
27
28
  <% end %>
28
- <%= @order.customer ? @order.customer.phone : @order.shipping_address.phone %>
29
+ <%= @order.customer ? @order.customer.phone : @order.shipping_address.phone %>
29
30
  </td>
30
31
  <td valign='top'>
31
- <%= "#{@order.shipping_address.name}" %><br />
32
+ <%= "#{@order.shipping_address.first_name} #{@order.shipping_address.last_name}" %><br />
32
33
  <%= raw shipping_address %>
33
34
  </td>
35
+ <td valign='top' align='center'>
36
+ <% if @order.shipping_service_code %>
37
+ <%= @order.shipping_carrier %> <%= @order.shipping_service_name %>
38
+ <% else %>
39
+ Multiple packages
40
+ <% end %>
41
+ </td>
34
42
  <td valign='top'>
35
43
  <div id='order_<%= @order.id %>_status'></div>
36
44
  </td>
37
- <td valign='top'>
45
+ <td valign='top' align='center'>
38
46
  <%= @order.financial_status %>
39
47
  <% if @order.financial_status == 'authorized' %>
40
- for <%= number_to_currency(@order.auth_amount) %>
48
+ for<br /><%= number_to_currency(@order.auth_amount) %>
41
49
  <% end %>
42
50
  </td>
43
- <td valign="top"><%= @order.transaction_id %></td>
51
+ <td valign="top" align='center'><%= @order.transaction_id %></td>
44
52
  </tr>
45
53
  </table><br />
46
54
 
@@ -77,7 +85,7 @@ captured = @order.financial_status == 'captured'
77
85
  <% end %>
78
86
  <tr><td colspan='5' align='right'>Subtotal </td><td align='right' id='subtotal' ><%= number_to_currency(@order.subtotal ) %></td></tr>
79
87
  <tr><td colspan='5' align='right'>Tax </td><td align='right' id='tax' ><%= number_to_currency(@order.tax ) %></td></tr>
80
- <tr><td colspan='5' align='right'><%= @order.shipping_method ? @order.shipping_method : '' %> Shipping &amp; Handling </td><td align='right' id='shipping'><%= number_to_currency(@order.shipping + @order.handling) %></td></tr>
88
+ <tr><td colspan='5' align='right'><%= @order.shipping_service_code ? @order.shipping_service_code : '' %> Shipping &amp; Handling </td><td align='right' id='shipping'><%= number_to_currency(@order.shipping + @order.handling) %></td></tr>
81
89
  <tr>
82
90
  <td colspan='5' align='right'>Discount</td>
83
91
  <td align='right'>
@@ -30,8 +30,8 @@
30
30
  <p><select name='shipping_method_code'>
31
31
  <optgroup label='Shipping Method'>
32
32
  <option value=''>-- All shipping methods --</option>
33
- <option value='03'<%= @pager.params['shipping_method_code'] == '02' ? " selected='true'" : '' %>>UPS Ground</option>
34
- <option value='02'<%= @pager.params['shipping_method_code'] == '02' ? " selected='true'" : '' %>>UPS 2nd Day</option>
33
+ <option value='03'<%= @pager.params['shipping_service_code'] == '02' ? " selected='true'" : '' %>>UPS Ground</option>
34
+ <option value='02'<%= @pager.params['shipping_service_code'] == '02' ? " selected='true'" : '' %>>UPS 2nd Day</option>
35
35
  </optgroup>
36
36
  </select></p>
37
37
  <p>
@@ -70,7 +70,7 @@
70
70
  <td><%= raw order.date_created %></td>
71
71
  <td align='right'><%= number_to_currency(order.total) %></td>
72
72
  <td><%= raw order.status %></td>
73
- <td><%= raw order.shipping_method %></td>
73
+ <td><%= raw order.shipping_carrier %> <%= raw order.shipping_service_name %></td>
74
74
  </tr>
75
75
  <% end %>
76
76
  </table>
data/config/routes.rb CHANGED
@@ -317,16 +317,21 @@ Caboose::Engine.routes.draw do
317
317
  get '/checkout/step-one' => 'checkout#step_one'
318
318
  get '/checkout/step-two' => 'checkout#step_two'
319
319
  get '/checkout/step-three' => 'checkout#step_three'
320
- get '/checkout/step-four' => 'checkout#step_four'
320
+ get '/checkout/step-four' => 'checkout#step_four'
321
321
  get '/checkout/thanks' => 'checkout#thanks'
322
322
 
323
- put '/checkout/address' => 'checkout#update_address'
324
- post '/checkout/attach-user' => 'checkout#attach_user'
325
- post '/checkout/attach-guest' => 'checkout#attach_guest'
326
- put '/checkout/shipping' => 'checkout#update_shipping'
327
- get '/checkout/relay/:order_id' => 'checkout#relay'
328
- post '/checkout/relay/:order_id' => 'checkout#relay'
329
- get '/checkout/empty' => 'checkout#empty'
323
+ get '/checkout/authnet-profile-form' => 'checkout#authnet_profile_form'
324
+ put '/checkout/address' => 'checkout#update_address'
325
+ post '/checkout/attach-user' => 'checkout#attach_user'
326
+ post '/checkout/attach-guest' => 'checkout#attach_guest'
327
+ put '/checkout/shipping' => 'checkout#update_shipping'
328
+ get '/checkout/authnet-relay/:order_id' => 'checkout#authnet_relay'
329
+ post '/checkout/authnet-relay/:order_id' => 'checkout#authnet_relay'
330
+ get '/checkout/authnet-relay' => 'checkout#authnet_relay'
331
+ post '/checkout/authnet-relay' => 'checkout#authnet_relay'
332
+ get '/checkout/authnet-response/:order_id' => 'checkout#authnet_response'
333
+ post '/checkout/authnet-response/:order_id' => 'checkout#authnet_response'
334
+ get '/checkout/empty' => 'checkout#empty'
330
335
 
331
336
  #=============================================================================
332
337
  # Products
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.5.60'
2
+ VERSION = '0.5.61'
3
3
  end
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.60
4
+ version: 0.5.61
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-11 00:00:00.000000000 Z
11
+ date: 2014-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -371,6 +371,7 @@ files:
371
371
  - app/assets/javascripts/caboose/admin_page_new_blocks.js
372
372
  - app/assets/javascripts/caboose/admin_products.js
373
373
  - app/assets/javascripts/caboose/application.js
374
+ - app/assets/javascripts/caboose/authorize.net.js
374
375
  - app/assets/javascripts/caboose/cart.js
375
376
  - app/assets/javascripts/caboose/cart2.js
376
377
  - app/assets/javascripts/caboose/checkout.js
@@ -465,6 +466,7 @@ files:
465
466
  - app/assets/templates/caboose/product/images.jst.ejs
466
467
  - app/assets/templates/caboose/product/images_old.jst.ejs
467
468
  - app/assets/templates/caboose/product/options.jst.ejs
469
+ - app/controllers/caboose/#Untitled-1#
468
470
  - app/controllers/caboose/ab_options_controller.rb
469
471
  - app/controllers/caboose/ab_variants_controller.rb
470
472
  - app/controllers/caboose/admin_controller.rb
@@ -520,6 +522,7 @@ files:
520
522
  - app/models/caboose/approval_request.rb
521
523
  - app/models/caboose/asset.rb
522
524
  - app/models/caboose/authenticator.rb
525
+ - app/models/caboose/authnet.rb
523
526
  - app/models/caboose/block.rb
524
527
  - app/models/caboose/block_cache.rb
525
528
  - app/models/caboose/block_cache_file.rb
@@ -659,6 +662,7 @@ files:
659
662
  - app/views/caboose/categories/admin_edit.html.erb
660
663
  - app/views/caboose/categories/admin_index.html.erb
661
664
  - app/views/caboose/categories/admin_new.html.erb
665
+ - app/views/caboose/checkout/#Untitled-2#
662
666
  - app/views/caboose/checkout/_address_form.html.erb
663
667
  - app/views/caboose/checkout/_billing_form.html.erb
664
668
  - app/views/caboose/checkout/_cart.html.erb
@@ -667,6 +671,9 @@ files:
667
671
  - app/views/caboose/checkout/_shipping_address.html.erb
668
672
  - app/views/caboose/checkout/_shipping_method.html.erb
669
673
  - app/views/caboose/checkout/_shipping_method_form.html.erb
674
+ - app/views/caboose/checkout/authnet_profile_form.html.erb
675
+ - app/views/caboose/checkout/authnet_relay.html.erb
676
+ - app/views/caboose/checkout/authnet_response.html.erb
670
677
  - app/views/caboose/checkout/billing.html.erb
671
678
  - app/views/caboose/checkout/discount.html.erb
672
679
  - app/views/caboose/checkout/empty.html.erb
@@ -674,11 +681,12 @@ files:
674
681
  - app/views/caboose/checkout/index.html.erb
675
682
  - app/views/caboose/checkout/login.html.erb
676
683
  - app/views/caboose/checkout/payment.html.erb
677
- - app/views/caboose/checkout/relay.html.erb
684
+ - app/views/caboose/checkout/payscape_relay.html.erb
678
685
  - app/views/caboose/checkout/relay_old.html.erb
679
686
  - app/views/caboose/checkout/relay_postMessage.html.erb
680
687
  - app/views/caboose/checkout/shipping.html.erb
681
688
  - app/views/caboose/checkout/step_four.html.erb
689
+ - app/views/caboose/checkout/step_four_old.html.erb
682
690
  - app/views/caboose/checkout/step_one.html.erb
683
691
  - app/views/caboose/checkout/step_one_old.html.erb
684
692
  - app/views/caboose/checkout/step_three.html.erb