spree_core 0.40.2 → 0.40.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,11 @@
1
1
  module CheckoutHelper
2
2
 
3
3
  def checkout_progress
4
- states = %w(address delivery payment confirm complete)
4
+ if Gateway.current and Gateway.current.payment_profiles_supported?
5
+ states = %w(address delivery payment confirm complete)
6
+ else
7
+ states = %w(address delivery payment complete)
8
+ end
5
9
  items = states.map do |state|
6
10
  text = t("order_state.#{state}").titleize
7
11
 
@@ -120,7 +120,7 @@ class Creditcard < ActiveRecord::Base
120
120
  end
121
121
 
122
122
  def void(payment)
123
- response = payment_gateway.void(payment.response_code, self, minimal_gateway_options(payment))
123
+ response = payment_gateway.void(payment.response_code, minimal_gateway_options(payment))
124
124
  record_log payment, response
125
125
 
126
126
  if response.success?
@@ -78,10 +78,11 @@ class Order < ActiveRecord::Base
78
78
  transition :from => 'cart', :to => 'address'
79
79
  transition :from => 'address', :to => 'delivery'
80
80
  transition :from => 'delivery', :to => 'payment'
81
- transition :from => 'payment', :to => 'confirm'
82
81
  transition :from => 'confirm', :to => 'complete'
82
+ # note: some payment methods will not support a confirm step
83
+ transition :from => 'payment', :to => 'confirm', :if => Proc.new { Gateway.current and Gateway.current.payment_profiles_supported? }
84
+ transition :from => 'payment', :to => 'complete'
83
85
  end
84
- #TODO - add conditional confirmation step (only when gateway supports it, etc.)
85
86
 
86
87
  event :cancel do
87
88
  transition :to => 'canceled', :if => :allow_cancel?
@@ -4,7 +4,7 @@
4
4
  <p class="field">
5
5
  <label for=""><%= t("card_number") %></label><br />
6
6
  <% options_hash = Rails.env.production? ? {:autocomplete => "off"} : {} %>
7
- <%= text_field_tag "#{param_prefix}[number]", '', options_hash.merge(:class => 'required', :size => 19, :maxlength => 19) %>
7
+ <%= text_field_tag "#{param_prefix}[number]", '', options_hash.merge(:id => 'card_number', :class => 'required', :size => 19, :maxlength => 19) %>
8
8
  <span class="req">*</span>
9
9
  &nbsp;
10
10
  <span id="card_type" style="display:none;">
@@ -19,9 +19,9 @@
19
19
  <%= select_year(Date.today, :prefix => param_prefix, :field_name => 'year', :start_year => Date.today.year, :end_year => Date.today.year + 15, :class => 'required') %>
20
20
  <span class="req">*</span>
21
21
  </p>
22
- <p class="field">
22
+ <p class="field">
23
23
  <label for=""><%= t("card_code") %></label><br />
24
- <%= text_field_tag "#{param_prefix}[verification_value]", '', options_hash.merge(:class => 'required', :size => 5) %>
24
+ <%= text_field_tag "#{param_prefix}[verification_value]", '', options_hash.merge(:id => 'card_code', :class => 'required', :size => 5) %>
25
25
  <span class="req">*</span>
26
26
  <a href="/content/cvv" target="_blank" onclick="window.open(this.href,'cvv_info','left=20,top=20,width=500,height=500,toolbar=0,resizable=0,scrollbars=1');return false">
27
27
  (<%= t("whats_this") %>)
@@ -67,7 +67,7 @@ end
67
67
 
68
68
  module Spree
69
69
  def self.version
70
- "0.40.2"
70
+ "0.40.3"
71
71
  end
72
72
  end
73
73
 
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: 187
4
+ hash: 185
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 40
9
- - 2
10
- version: 0.40.2
9
+ - 3
10
+ version: 0.40.3
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-01-17 00:00:00 -05:00
18
+ date: 2011-02-17 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -217,12 +217,12 @@ dependencies:
217
217
  requirements:
218
218
  - - "="
219
219
  - !ruby/object:Gem::Version
220
- hash: 1
220
+ hash: 15
221
221
  segments:
222
222
  - 3
223
223
  - 0
224
- - 3
225
- version: 3.0.3
224
+ - 4
225
+ version: 3.0.4
226
226
  type: :runtime
227
227
  version_requirements: *id013
228
228
  - !ruby/object:Gem::Dependency