effective_orders 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e8d141053c95493bf5fdd56d7fed89546813995
4
- data.tar.gz: d5b381799fe9984c0b81da4116af1faa468d2af2
3
+ metadata.gz: 7c9a7700d9145bc57026646a8ef90acc261cbdac
4
+ data.tar.gz: a35fd250cc3e386888be37deab0e5b5e793a3791
5
5
  SHA512:
6
- metadata.gz: f39d818fc70058225e0912a11a9caa299fb52fdbff23c397d1fa9cb936015d351c3ab509334afe2ab6f24cb7744c73fa9ba64b69e7a851a891744e92acd19059
7
- data.tar.gz: 5a6a69fd2abfa9326f0fcf1cddeb85975c95fe427dbb59591e68a34f31d50188aed6a14629c3cbc090f5c5a07d9918ec69958e878dcb56ea59fa6506014b189b
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 < 0.01 && @order.total >= 0.00 && EffectiveOrders.allow_free_orders
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
- = f.submit 'Continue to Checkout Confirmation', :class => 'btn btn-primary pull-right', :rel => :nofollow, 'data-disable-with' => 'Continuing...'
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 true || EffectiveOrders.allow_pretend_purchase_in_production
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 payment information is not required to process this order at this time.
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
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
@@ -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.0.0
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-08 00:00:00.000000000 Z
11
+ date: 2014-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails