effective_orders 1.0.0 → 1.1.0
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/controllers/effective/orders_controller.rb +1 -1
- data/app/helpers/effective_orders_helper.rb +1 -2
- data/app/views/effective/orders/_checkout_step_1.html.haml +6 -2
- data/app/views/effective/orders/_checkout_step_2.html.haml +2 -3
- data/lib/effective_orders/version.rb +1 -1
- data/lib/effective_orders.rb +2 -0
- data/lib/generators/templates/effective_orders.rb +1 -0
- 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: 7c9a7700d9145bc57026646a8ef90acc261cbdac
|
4
|
+
data.tar.gz: a35fd250cc3e386888be37deab0e5b5e793a3791
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b59994fba1055c8bb4591e5677032c8b13d04b9df52bd44a5e8dcebc5929a6c6bf37638ee36dd73280cddac77658052f8fbf9ab2241b0e1be19d5d07eacf4694
|
7
|
+
data.tar.gz: aba3e9ecceb9916ad7b91ff23fff5b021cfa033a819a544d8f7fd7bbafb8fbf9c8f9951437b09afadcbd488a5e3ae72c10f95ca122a0b383f1295d9360f6fa17
|
@@ -50,7 +50,7 @@ module Effective
|
|
50
50
|
|
51
51
|
@order.save!
|
52
52
|
|
53
|
-
if @order.total
|
53
|
+
if @order.total == 0 && EffectiveOrders.allow_free_orders
|
54
54
|
order_purchased('zero-dollar order')
|
55
55
|
else
|
56
56
|
redirect_to(effective_orders.order_path(@order))
|
@@ -67,10 +67,9 @@ module EffectiveOrdersHelper
|
|
67
67
|
:declined_redirect_url => nil
|
68
68
|
}.merge(opts)
|
69
69
|
|
70
|
-
if order.new_record?
|
70
|
+
if order.new_record? || !order.valid?
|
71
71
|
render(:partial => 'effective/orders/checkout_step_1', :locals => locals.merge({:order => order}))
|
72
72
|
else
|
73
|
-
raise ArgumentError.new('unable to checkout a persisted but invalid order') unless order.valid?
|
74
73
|
render(:partial => 'effective/orders/checkout_step_2', :locals => locals.merge({:order => order}))
|
75
74
|
end
|
76
75
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.effective-order
|
2
2
|
= simple_form_for(order, (EffectiveOrders.simple_form_options || {}).merge(:url => effective_orders.orders_path)) do |f|
|
3
|
-
= render :partial => 'order_items', :locals => {:order => order, :form => f}
|
3
|
+
= render :partial => 'effective/orders/order_items', :locals => {:order => order, :form => f}
|
4
4
|
|
5
5
|
- if order.errors[:order_items].present?
|
6
6
|
%p.inline-errors= order.errors[:order_items].first
|
@@ -36,4 +36,8 @@
|
|
36
36
|
|
37
37
|
%hr
|
38
38
|
= link_to_current_cart :label => 'Change Items', :class => 'btn btn-default'
|
39
|
-
|
39
|
+
|
40
|
+
- if order.total == 0 && EffectiveOrders.allow_free_orders
|
41
|
+
= f.submit 'Checkout', :class => 'btn btn-primary pull-right', :rel => :nofollow, 'data-disable-with' => 'Continuing...'
|
42
|
+
- else
|
43
|
+
= f.submit 'Continue to Checkout Confirmation', :class => 'btn btn-primary pull-right', :rel => :nofollow, 'data-disable-with' => 'Continuing...'
|
@@ -9,10 +9,9 @@
|
|
9
9
|
- if EffectiveOrders.stripe_enabled
|
10
10
|
= render :partial => '/effective/orders/stripe/form', :locals => {:order => order}
|
11
11
|
|
12
|
-
- if
|
12
|
+
- if EffectiveOrders.allow_pretend_purchase_in_production
|
13
13
|
= link_to 'Process Order', effective_orders.pretend_purchase_path(order, :purchased_redirect_url => purchased_redirect_url, :declined_redirect_url => declined_redirect_url), :class => 'btn btn-primary'
|
14
|
-
%p
|
15
|
-
%p * credit card details are not currently required to process this order
|
14
|
+
%p= EffectiveOrders.allow_pretend_purchase_in_production_message
|
16
15
|
- elsif Rails.env.development?
|
17
16
|
= link_to 'Process Order (development only)', effective_orders.pretend_purchase_path(order, :purchased_redirect_url => purchased_redirect_url, :declined_redirect_url => declined_redirect_url), :class => 'btn btn-primary'
|
18
17
|
|
data/lib/effective_orders.rb
CHANGED
@@ -22,7 +22,9 @@ module EffectiveOrders
|
|
22
22
|
mattr_accessor :use_active_admin
|
23
23
|
mattr_accessor :obfuscate_order_ids
|
24
24
|
mattr_accessor :silence_deprecation_warnings
|
25
|
+
|
25
26
|
mattr_accessor :allow_pretend_purchase_in_production
|
27
|
+
mattr_accessor :allow_pretend_purchase_in_production_message
|
26
28
|
|
27
29
|
mattr_accessor :require_billing_address
|
28
30
|
mattr_accessor :require_shipping_address
|
@@ -78,6 +78,7 @@ EffectiveOrders.setup do |config|
|
|
78
78
|
# Clicking this button will mark an Order purchased and redirect the user to the
|
79
79
|
# Thank You page just as if they had successfully Checked Out through a payment processor
|
80
80
|
config.allow_pretend_purchase_in_production = false
|
81
|
+
config.allow_pretend_purchase_in_production_message = '* payment information is not required to process this order at this time.'
|
81
82
|
|
82
83
|
|
83
84
|
# Layout Settings
|
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.
|
4
|
+
version: 1.1.0
|
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: 2014-12-
|
11
|
+
date: 2014-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|