spree_core 0.50.0 → 0.50.1
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.
@@ -1,22 +1,15 @@
|
|
1
1
|
class ContentController < Spree::BaseController
|
2
|
-
|
3
|
-
before_filter
|
2
|
+
# Don't serve local files or static assets
|
3
|
+
before_filter { render_404 if params[:path] =~ /(\.|\\)/ }
|
4
4
|
|
5
5
|
rescue_from ActionView::MissingTemplate, :with => :render_404
|
6
6
|
caches_page :show, :index, :if => Proc.new { Spree::Config[:cache_static_content] }
|
7
7
|
|
8
8
|
def show
|
9
|
-
render params[:path]
|
9
|
+
render :template => params[:path]
|
10
10
|
end
|
11
11
|
|
12
12
|
def cvv
|
13
13
|
render "cvv", :layout => false
|
14
14
|
end
|
15
|
-
|
16
|
-
private
|
17
|
-
# Determines if the requested resource has a path similar to that of a static asset. In this case do not go through the
|
18
|
-
# overhead of trying to render a template or whatever.
|
19
|
-
def static_asset
|
20
|
-
params[:path] =~ /^\/([^.]+)$/
|
21
|
-
end
|
22
15
|
end
|
data/app/models/payment.rb
CHANGED
@@ -1,2 +1,27 @@
|
|
1
1
|
class PaymentMethod::Check < PaymentMethod
|
2
|
-
|
2
|
+
def actions
|
3
|
+
%w{capture void}
|
4
|
+
end
|
5
|
+
|
6
|
+
# Indicates whether its possible to capture the payment
|
7
|
+
def can_capture?(payment)
|
8
|
+
['checkout', 'pending'].include?(payment.state)
|
9
|
+
end
|
10
|
+
|
11
|
+
# Indicates whether its possible to void the payment.
|
12
|
+
def can_void?(payment)
|
13
|
+
payment.state != 'void'
|
14
|
+
end
|
15
|
+
|
16
|
+
def capture(payment)
|
17
|
+
payment.update_attribute(:state, 'pending') if payment.state == 'checkout'
|
18
|
+
payment.complete
|
19
|
+
true
|
20
|
+
end
|
21
|
+
|
22
|
+
def void(payment)
|
23
|
+
payment.update_attribute(:state, 'pending') if payment.state == 'checkout'
|
24
|
+
payment.void
|
25
|
+
true
|
26
|
+
end
|
27
|
+
end
|
data/lib/spree/current_order.rb
CHANGED
@@ -14,7 +14,9 @@ module Spree
|
|
14
14
|
# The current incomplete order from the session for use in cart and during checkout
|
15
15
|
def current_order(create_order_if_necessary = false)
|
16
16
|
return @current_order if @current_order
|
17
|
-
|
17
|
+
if session[:order_id]
|
18
|
+
@current_order = Order.find_by_id(session[:order_id], :include => :adjustments)
|
19
|
+
end
|
18
20
|
if create_order_if_necessary and (@current_order.nil? or @current_order.completed?)
|
19
21
|
@current_order = Order.new
|
20
22
|
before_save_new_order
|
data/lib/spree_core/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 213
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 50
|
9
|
-
-
|
10
|
-
version: 0.50.
|
9
|
+
- 1
|
10
|
+
version: 0.50.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sean Schofield
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-04-19 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -200,11 +200,12 @@ dependencies:
|
|
200
200
|
requirements:
|
201
201
|
- - "="
|
202
202
|
- !ruby/object:Gem::Version
|
203
|
-
hash:
|
203
|
+
hash: 1923831917
|
204
204
|
segments:
|
205
205
|
- 3
|
206
206
|
- 0
|
207
|
-
-
|
207
|
+
- pre
|
208
|
+
- 2
|
208
209
|
version: 3.0.pre2
|
209
210
|
type: :runtime
|
210
211
|
version_requirements: *id012
|
@@ -216,12 +217,12 @@ dependencies:
|
|
216
217
|
requirements:
|
217
218
|
- - "="
|
218
219
|
- !ruby/object:Gem::Version
|
219
|
-
hash:
|
220
|
+
hash: 11
|
220
221
|
segments:
|
221
222
|
- 3
|
222
223
|
- 0
|
223
|
-
-
|
224
|
-
version: 3.0.
|
224
|
+
- 6
|
225
|
+
version: 3.0.6
|
225
226
|
type: :runtime
|
226
227
|
version_requirements: *id013
|
227
228
|
- !ruby/object:Gem::Dependency
|
@@ -1125,7 +1126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1125
1126
|
requirements:
|
1126
1127
|
- none
|
1127
1128
|
rubyforge_project: spree_core
|
1128
|
-
rubygems_version: 1.
|
1129
|
+
rubygems_version: 1.4.2
|
1129
1130
|
signing_key:
|
1130
1131
|
specification_version: 3
|
1131
1132
|
summary: Core e-commerce functionality for the Spree project.
|