Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

namespacing for Spree 1.0

  • Loading branch information...
commit 8ffb3975a05bc8a064a8c1419ad114ac0de38e69 1 parent 90a60d4
Chris Mar authored
5  Gemfile
@@ -3,8 +3,6 @@ source 'http://rubygems.org'
3 3
 gem 'sqlite3'
4 4
 
5 5
 group :test do
6  
-  gem 'rspec-rails', '= 2.7.0'
7  
-  gem 'factory_girl', '= 1.3.3'
8 6
   gem 'factory_girl_rails', '= 1.0.1'
9 7
   gem 'faker'
10 8
 end
@@ -15,4 +13,7 @@ else
15 13
   gem "ruby-debug19"
16 14
 end
17 15
 
  16
+gem 'rails', '3.1.3'
  17
+gem 'spree', :git => 'https://github.com/spree/spree.git'
  18
+
18 19
 gemspec
151  Gemfile.lock
... ...
@@ -1,3 +1,44 @@
  1
+GIT
  2
+  remote: https://github.com/spree/spree.git
  3
+  revision: 6525d8094f5ed23b6b17e452da3f3b5e6e9f9ee8
  4
+  specs:
  5
+    spree (1.0.0.beta)
  6
+      spree_api (= 1.0.0.beta)
  7
+      spree_auth (= 1.0.0.beta)
  8
+      spree_core (= 1.0.0.beta)
  9
+      spree_dash (= 1.0.0.beta)
  10
+      spree_promo (= 1.0.0.beta)
  11
+      spree_sample (= 1.0.0.beta)
  12
+    spree_api (1.0.0.beta)
  13
+      spree_auth (= 1.0.0.beta)
  14
+      spree_core (= 1.0.0.beta)
  15
+    spree_auth (1.0.0.beta)
  16
+      cancan (= 1.6.7)
  17
+      devise (= 1.4.8)
  18
+      spree_core (= 1.0.0.beta)
  19
+    spree_core (1.0.0.beta)
  20
+      activemerchant (= 1.17.0)
  21
+      acts_as_list (= 0.1.4)
  22
+      deface (>= 0.7.2)
  23
+      ffaker (~> 1.10.1)
  24
+      highline (= 1.6.2)
  25
+      jquery-rails (>= 1.0.18)
  26
+      kaminari (>= 0.12.4)
  27
+      meta_search (= 1.1.1)
  28
+      nested_set (= 1.6.8)
  29
+      paperclip (= 2.4.1)
  30
+      rails (>= 3.1.1, <= 3.1.3)
  31
+      rd_find_by_param (= 0.1.1)
  32
+      state_machine (= 1.1.0)
  33
+      stringex (~> 1.3.0)
  34
+    spree_dash (1.0.0.beta)
  35
+      spree_core (= 1.0.0.beta)
  36
+    spree_promo (1.0.0.beta)
  37
+      spree_auth (= 1.0.0.beta)
  38
+      spree_core (= 1.0.0.beta)
  39
+    spree_sample (1.0.0.beta)
  40
+      spree_core (= 1.0.0.beta)
  41
+
1 42
 PATH
2 43
   remote: .
3 44
   specs:
@@ -7,64 +48,71 @@ PATH
7 48
 GEM
8 49
   remote: http://rubygems.org/
9 50
   specs:
10  
-    actionmailer (3.1.1)
11  
-      actionpack (= 3.1.1)
  51
+    actionmailer (3.1.3)
  52
+      actionpack (= 3.1.3)
12 53
       mail (~> 2.3.0)
13  
-    actionpack (3.1.1)
14  
-      activemodel (= 3.1.1)
15  
-      activesupport (= 3.1.1)
  54
+    actionpack (3.1.3)
  55
+      activemodel (= 3.1.3)
  56
+      activesupport (= 3.1.3)
16 57
       builder (~> 3.0.0)
17 58
       erubis (~> 2.7.0)
18 59
       i18n (~> 0.6)
19  
-      rack (~> 1.3.2)
  60
+      rack (~> 1.3.5)
20 61
       rack-cache (~> 1.1)
21 62
       rack-mount (~> 0.8.2)
22 63
       rack-test (~> 0.6.1)
23  
-      sprockets (~> 2.0.2)
  64
+      sprockets (~> 2.0.3)
24 65
     activemerchant (1.17.0)
25 66
       activesupport (>= 2.3.11)
26 67
       braintree (>= 2.0.0)
27 68
       builder (>= 2.0.0)
28 69
       json (>= 1.5.1)
29  
-    activemodel (3.1.1)
30  
-      activesupport (= 3.1.1)
  70
+    activemodel (3.1.3)
  71
+      activesupport (= 3.1.3)
31 72
       builder (~> 3.0.0)
32 73
       i18n (~> 0.6)
33  
-    activerecord (3.1.1)
34  
-      activemodel (= 3.1.1)
35  
-      activesupport (= 3.1.1)
  74
+    activerecord (3.1.3)
  75
+      activemodel (= 3.1.3)
  76
+      activesupport (= 3.1.3)
36 77
       arel (~> 2.2.1)
37 78
       tzinfo (~> 0.3.29)
38  
-    activeresource (3.1.1)
39  
-      activemodel (= 3.1.1)
40  
-      activesupport (= 3.1.1)
41  
-    activesupport (3.1.1)
  79
+    activeresource (3.1.3)
  80
+      activemodel (= 3.1.3)
  81
+      activesupport (= 3.1.3)
  82
+    activesupport (3.1.3)
42 83
       multi_json (~> 1.0)
43 84
     acts_as_list (0.1.4)
44 85
     arel (2.2.1)
  86
+    bcrypt-ruby (3.0.1)
45 87
     braintree (2.13.1)
46 88
       builder (>= 2.0.0)
47 89
     builder (3.0.0)
48  
-    cocaine (0.2.0)
49  
-    columnize (0.3.4)
50  
-    deface (0.7.1)
  90
+    cancan (1.6.7)
  91
+    cocaine (0.2.1)
  92
+    columnize (0.3.6)
  93
+    deface (0.7.2)
51 94
       nokogiri (~> 1.5.0)
52 95
       rails (>= 3.0.9)
  96
+    devise (1.4.8)
  97
+      bcrypt-ruby (~> 3.0)
  98
+      orm_adapter (~> 0.0.3)
  99
+      warden (~> 1.0.3)
53 100
     diff-lcs (1.1.3)
54 101
     erubis (2.7.0)
55 102
     factory_girl (1.3.3)
56 103
     factory_girl_rails (1.0.1)
57 104
       factory_girl (~> 1.3)
58 105
       railties (>= 3.0.0)
59  
-    faker (1.0.0)
  106
+    faker (1.0.1)
60 107
       i18n (~> 0.4)
61  
-    highline (1.5.1)
  108
+    ffaker (1.10.1)
  109
+    highline (1.6.2)
62 110
     hike (1.2.1)
63 111
     i18n (0.6.0)
64  
-    jquery-rails (1.0.17)
  112
+    jquery-rails (1.0.19)
65 113
       railties (~> 3.0)
66 114
       thor (~> 0.14)
67  
-    json (1.6.1)
  115
+    json (1.6.3)
68 116
     kaminari (0.12.4)
69 117
       rails (>= 3.0.0)
70 118
     linecache (0.46)
@@ -79,11 +127,12 @@ GEM
79 127
       activesupport (~> 3.1.0)
80 128
       polyamorous (~> 0.5.0)
81 129
     mime-types (1.17.2)
82  
-    multi_json (1.0.3)
  130
+    multi_json (1.0.4)
83 131
     nested_set (1.6.8)
84 132
       activerecord (>= 3.0.0)
85 133
       railties (>= 3.0.0)
86 134
     nokogiri (1.5.0)
  135
+    orm_adapter (0.0.5)
87 136
     paperclip (2.4.1)
88 137
       activerecord (>= 2.3.0)
89 138
       activesupport (>= 2.3.2)
@@ -101,17 +150,17 @@ GEM
101 150
       rack
102 151
     rack-test (0.6.1)
103 152
       rack (>= 1.0)
104  
-    rails (3.1.1)
105  
-      actionmailer (= 3.1.1)
106  
-      actionpack (= 3.1.1)
107  
-      activerecord (= 3.1.1)
108  
-      activeresource (= 3.1.1)
109  
-      activesupport (= 3.1.1)
  153
+    rails (3.1.3)
  154
+      actionmailer (= 3.1.3)
  155
+      actionpack (= 3.1.3)
  156
+      activerecord (= 3.1.3)
  157
+      activeresource (= 3.1.3)
  158
+      activesupport (= 3.1.3)
110 159
       bundler (~> 1.0)
111  
-      railties (= 3.1.1)
112  
-    railties (3.1.1)
113  
-      actionpack (= 3.1.1)
114  
-      activesupport (= 3.1.1)
  160
+      railties (= 3.1.3)
  161
+    railties (3.1.3)
  162
+      actionpack (= 3.1.3)
  163
+      activesupport (= 3.1.3)
115 164
       rack-ssl (~> 1.3.2)
116 165
       rake (>= 0.8.7)
117 166
       rdoc (~> 3.4)
@@ -121,8 +170,7 @@ GEM
121 170
     rd_find_by_param (0.1.1)
122 171
       activerecord (~> 3.0)
123 172
       activesupport (~> 3.0)
124  
-    rd_resource_controller (1.0.1)
125  
-    rdoc (3.11)
  173
+    rdoc (3.12)
126 174
       json (~> 1.4)
127 175
     rspec (2.7.0)
128 176
       rspec-core (~> 2.7.0)
@@ -142,44 +190,31 @@ GEM
142 190
       ruby-debug-base (~> 0.10.4.0)
143 191
     ruby-debug-base (0.10.4)
144 192
       linecache (>= 0.3)
145  
-    spree_core (0.70.1)
146  
-      activemerchant (= 1.17.0)
147  
-      acts_as_list (= 0.1.4)
148  
-      deface (>= 0.7.0)
149  
-      faker (= 1.0.0)
150  
-      highline (= 1.5.1)
151  
-      jquery-rails (>= 1.0.14)
152  
-      kaminari (>= 0.12.4)
153  
-      meta_search (= 1.1.1)
154  
-      nested_set (= 1.6.8)
155  
-      paperclip (= 2.4.1)
156  
-      rails (= 3.1.1)
157  
-      rd_find_by_param (= 0.1.1)
158  
-      rd_resource_controller
159  
-      state_machine (= 1.0.1)
160  
-      stringex (= 1.0.3)
161 193
     sprockets (2.0.3)
162 194
       hike (~> 1.2)
163 195
       rack (~> 1.0)
164  
-      tilt (~> 1.1, != 1.3.0)
165  
-    sqlite3 (1.3.4)
166  
-    state_machine (1.0.1)
167  
-    stringex (1.0.3)
  196
+      tilt (!= 1.3.0, ~> 1.1)
  197
+    sqlite3 (1.3.5)
  198
+    state_machine (1.1.0)
  199
+    stringex (1.3.0)
168 200
     thor (0.14.6)
169 201
     tilt (1.3.3)
170 202
     treetop (1.4.10)
171 203
       polyglot
172 204
       polyglot (>= 0.3.1)
173 205
     tzinfo (0.3.31)
  206
+    warden (1.0.6)
  207
+      rack (>= 1.0)
174 208
 
175 209
 PLATFORMS
176 210
   ruby
177 211
 
178 212
 DEPENDENCIES
179  
-  factory_girl (= 1.3.3)
180 213
   factory_girl_rails (= 1.0.1)
181 214
   faker
182  
-  rspec-rails (= 2.7.0)
  215
+  rails (= 3.1.3)
  216
+  rspec-rails
183 217
   ruby-debug
  218
+  spree!
184 219
   spree_skrill!
185 220
   sqlite3
2  Rakefile
@@ -3,7 +3,7 @@ require 'rake/testtask'
3 3
 require 'rake/packagetask'
4 4
 require 'rubygems/package_task'
5 5
 require 'rspec/core/rake_task'
6  
-require 'spree_core/testing_support/common_rake'
  6
+require 'spree/core/testing_support/common_rake'
7 7
 
8 8
 RSpec::Core::RakeTask.new
9 9
 
30  app/controllers/checkout_controller_decorator.rb
... ...
@@ -1,30 +0,0 @@
1  
-CheckoutController.class_eval do
2  
-  def skrill_cancel
3  
-    flash[:error] = t(:payment_has_been_cancelled)
4  
-    redirect_to edit_order_checkout_url(@order, :state => 'payment')
5  
-  end
6  
-
7  
-  def skrill_success
8  
-    @order = Order.where(:number => params[:order_id]).first
9  
-
10  
-    if @order.token == params[:token]
11  
-
12  
-      if @order.payments.where(:source_type => 'SkrillAccount').present?
13  
-
14  
-        #need to force checkout to complete state
15  
-        until @order.state == "complete"
16  
-          if @order.next!
17  
-            @order.update!
18  
-            state_callback(:after)
19  
-          end
20  
-        end
21  
-      end
22  
-
23  
-      flash.notice = t(:order_processed_successfully)
24  
-      redirect_to completion_route
25  
-    else
26  
-      redirect_to root_url
27  
-    end
28  
-
29  
-  end
30  
-end
24  app/controllers/skrill_status_controller.rb
... ...
@@ -1,24 +0,0 @@
1  
-class SkrillStatusController < ApplicationController
2  
-  def update
3  
-    payment_id = params[:transaction_id].split('-').last
4  
-
5  
-    payment = Payment.find(payment_id)
6  
-
7  
-    unless payment.completed?
8  
-
9  
-      case params[:status]
10  
-        when "0"
11  
-          payment.pend #may already be pending
12  
-        when "2" #processed / captured
13  
-          payment.complete!
14  
-        when "-1", "-2"
15  
-          payment.failure!
16  
-        else
17  
-          raise "Unexpected payment status"
18  
-      end
19  
-
20  
-    end
21  
-
22  
-    render :text => ""
23  
-  end
24  
-end
32  app/controllers/spree/checkout_controller_decorator.rb
... ...
@@ -0,0 +1,32 @@
  1
+module Spree
  2
+  CheckoutController.class_eval do
  3
+    def skrill_cancel
  4
+      flash[:error] = t(:payment_has_been_cancelled)
  5
+      redirect_to edit_order_checkout_url(@order, :state => 'payment')
  6
+    end
  7
+
  8
+    def skrill_success
  9
+      @order = Order.where(:number => params[:order_id]).first
  10
+
  11
+      if @order.token == params[:token]
  12
+
  13
+        if @order.payments.where(:source_type => 'SkrillAccount').present?
  14
+
  15
+          #need to force checkout to complete state
  16
+          until @order.state == "complete"
  17
+            if @order.next!
  18
+              @order.update!
  19
+              state_callback(:after)
  20
+            end
  21
+          end
  22
+        end
  23
+
  24
+        flash.notice = t(:order_processed_successfully)
  25
+        redirect_to completion_route
  26
+      else
  27
+        redirect_to root_url
  28
+      end
  29
+
  30
+    end
  31
+  end
  32
+end
26  app/controllers/spree/skrill_status_controller.rb
... ...
@@ -0,0 +1,26 @@
  1
+module Spree
  2
+  class SkrillStatusController < ApplicationController
  3
+    def update
  4
+      payment_id = params[:transaction_id].split('-').last
  5
+
  6
+      payment = Payment.find(payment_id)
  7
+
  8
+      unless payment.completed?
  9
+
  10
+        case params[:status]
  11
+          when "0"
  12
+            payment.pend #may already be pending
  13
+          when "2" #processed / captured
  14
+            payment.complete!
  15
+          when "-1", "-2"
  16
+            payment.failure!
  17
+          else
  18
+            raise "Unexpected payment status"
  19
+        end
  20
+
  21
+      end
  22
+
  23
+      render :text => ""
  24
+    end
  25
+  end
  26
+end
29  app/helpers/checkout_helper_decorator.rb
... ...
@@ -1,29 +0,0 @@
1  
-CheckoutHelper.module_eval do
2  
-  def checkout_progress
3  
-    states = checkout_states
4  
-    items = states.map do |state|
5  
-      text = t("order_state.#{state}").titleize
6  
-
7  
-      css_classes = []
8  
-      if @order.skrill?
9  
-        current_index = states.index('payment')
10  
-      else
11  
-        current_index = states.index(@order.state)
12  
-      end
13  
-      state_index = states.index(state)
14  
-
15  
-      if state_index < current_index
16  
-        css_classes << 'completed'
17  
-        text = link_to text, checkout_state_path(state)
18  
-      end
19  
-
20  
-      css_classes << 'next' if state_index == current_index + 1
21  
-      css_classes << 'current' if state == @order.state
22  
-      css_classes << 'first' if state_index == 0
23  
-      css_classes << 'last' if state_index == states.length - 1
24  
-      # It'd be nice to have separate classes but combining them with a dash helps out for IE6 which only sees the last class
25  
-      content_tag('li', content_tag('span', text), :class => css_classes.join('-'))
26  
-    end
27  
-    content_tag('ol', raw(items.join("\n")), :class => 'progress-steps', :id => "checkout-step-#{@order.state}")
28  
-  end
29  
-end
31  app/helpers/spree/checkout_helper_decorator.rb
... ...
@@ -0,0 +1,31 @@
  1
+module Spree
  2
+  CheckoutHelper.module_eval do
  3
+    def checkout_progress
  4
+      states = checkout_states
  5
+      items = states.map do |state|
  6
+        text = t("order_state.#{state}").titleize
  7
+
  8
+        css_classes = []
  9
+        if @order.skrill?
  10
+          current_index = states.index('payment')
  11
+        else
  12
+          current_index = states.index(@order.state)
  13
+        end
  14
+        state_index = states.index(state)
  15
+
  16
+        if state_index < current_index
  17
+          css_classes << 'completed'
  18
+          text = link_to text, checkout_state_path(state)
  19
+        end
  20
+
  21
+        css_classes << 'next' if state_index == current_index + 1
  22
+        css_classes << 'current' if state == @order.state
  23
+        css_classes << 'first' if state_index == 0
  24
+        css_classes << 'last' if state_index == states.length - 1
  25
+        # It'd be nice to have separate classes but combining them with a dash helps out for IE6 which only sees the last class
  26
+        content_tag('li', content_tag('span', text), :class => css_classes.join('-'))
  27
+      end
  28
+      content_tag('ol', raw(items.join("\n")), :class => 'progress-steps', :id => "checkout-step-#{@order.state}")
  29
+    end
  30
+  end
  31
+end
46  app/models/billing_integration/skrill/quick_checkout.rb
... ...
@@ -1,46 +0,0 @@
1  
-class BillingIntegration::Skrill::QuickCheckout < BillingIntegration
2  
-  preference :merchant_id, :string
3  
-  preference :language, :string, :default => 'EN'
4  
-  preference :currency, :string, :default => 'EUR'
5  
-  preference :payment_options, :string, :default => 'ACC'
6  
-
7  
-  def provider_class
8  
-    ActiveMerchant::Billing::Skrill
9  
-  end
10  
-
11  
-  def redirect_url(order, opts = {})
12  
-    opts.merge! self.preferences
13  
-
14  
-    set_global_options(opts)
15  
-
16  
-    opts[:detail1_text] = order.number
17  
-    opts[:detail1_description] = 'Order Number:'
18  
-
19  
-    opts[:pay_from_email] = order.email
20  
-    opts[:firstname] = order.bill_address.firstname
21  
-    opts[:lastname] = order.bill_address.lastname
22  
-    opts[:address] = order.bill_address.address1
23  
-    opts[:address2] = order.bill_address.address2
24  
-    opts[:phone_number] = order.bill_address.phone
25  
-    opts[:city] = order.bill_address.city
26  
-    opts[:postal_code] = order.bill_address.zipcode
27  
-    opts[:state] = order.bill_address.state.nil? ? order.bill_address.state_name.to_s : order.bill_address.state.abbr
28  
-    opts[:country] = order.bill_address.country.name
29  
-
30  
-    opts[:hide_login] = 1
31  
-    opts[:merchant_fields] = 'platform'
32  
-    opts[:platform] = 'Spree'
33  
-
34  
-    skrill = self.provider
35  
-    skrill.payment_url(opts)
36  
-  end
37  
-
38  
-  private
39  
-    def set_global_options(opts)
40  
-      opts[:recipient_description] = Spree::Config[:site_name]
41  
-      opts[:payment_methods] = self.preferred_payment_options
42  
-    end
43  
-
44  
-end
45  
-
46  
-
7  app/models/skrill_account.rb
... ...
@@ -1,7 +0,0 @@
1  
-class SkrillAccount < ActiveRecord::Base
2  
-  has_many :payments, :as => :source
3  
-
4  
-  def actions
5  
-    []
6  
-  end
7  
-end
46  app/models/spree/billing_integration/skrill/quick_checkout.rb
... ...
@@ -0,0 +1,46 @@
  1
+module Spree
  2
+  class BillingIntegration::Skrill::QuickCheckout < BillingIntegration
  3
+    preference :merchant_id, :string
  4
+    preference :language, :string, :default => 'EN'
  5
+    preference :currency, :string, :default => 'EUR'
  6
+    preference :payment_options, :string, :default => 'ACC'
  7
+
  8
+    def provider_class
  9
+      ActiveMerchant::Billing::Skrill
  10
+    end
  11
+
  12
+    def redirect_url(order, opts = {})
  13
+      opts.merge! self.preferences
  14
+
  15
+      set_global_options(opts)
  16
+
  17
+      opts[:detail1_text] = order.number
  18
+      opts[:detail1_description] = 'Order Number:'
  19
+
  20
+      opts[:pay_from_email] = order.email
  21
+      opts[:firstname] = order.bill_address.firstname
  22
+      opts[:lastname] = order.bill_address.lastname
  23
+      opts[:address] = order.bill_address.address1
  24
+      opts[:address2] = order.bill_address.address2
  25
+      opts[:phone_number] = order.bill_address.phone
  26
+      opts[:city] = order.bill_address.city
  27
+      opts[:postal_code] = order.bill_address.zipcode
  28
+      opts[:state] = order.bill_address.state.nil? ? order.bill_address.state_name.to_s : order.bill_address.state.abbr
  29
+      opts[:country] = order.bill_address.country.name
  30
+
  31
+      opts[:hide_login] = 1
  32
+      opts[:merchant_fields] = 'platform'
  33
+      opts[:platform] = 'Spree'
  34
+
  35
+      skrill = self.provider
  36
+      skrill.payment_url(opts)
  37
+    end
  38
+
  39
+    private
  40
+      def set_global_options(opts)
  41
+        opts[:recipient_description] = Spree::Config[:site_name]
  42
+        opts[:payment_methods] = self.preferred_payment_options
  43
+      end
  44
+
  45
+  end
  46
+end
9  app/models/spree/skrill_account.rb
... ...
@@ -0,0 +1,9 @@
  1
+module Spree
  2
+  class SkrillAccount < ActiveRecord::Base
  3
+    has_many :payments, :as => :source
  4
+
  5
+    def actions
  6
+      []
  7
+    end
  8
+  end
  9
+end
0  app/views/checkout/_skrill.html.erb → app/views/spree/checkout/_skrill.html.erb
File renamed without changes
0  app/views/checkout/payment/_quickcheckout.html.erb → ...ws/spree/checkout/payment/_quickcheckout.html.erb
File renamed without changes
0  app/views/shared/_skrill_status.html.erb → app/views/spree/shared/_skrill_status.html.erb
File renamed without changes
13  lib/spree_skrill/engine.rb
@@ -10,19 +10,19 @@ class Engine < Rails::Engine
10 10
     end
11 11
 
12 12
     def self.activate
13  
-      Order.state_machine.states << skrill_state = StateMachine::State.new(Order.state_machine, 'skrill')
  13
+      Spree::Order.state_machine.states << skrill_state = StateMachine::State.new(Spree::Order.state_machine, 'skrill')
14 14
 
15  
-      Order.state_machine.events << next_event = StateMachine::Event.new(Order.state_machine, :next)
  15
+      Spree::Order.state_machine.events << next_event = StateMachine::Event.new(Spree::Order.state_machine, :next)
16 16
       next_event.transition :from => 'cart', :to => 'address'
17 17
       next_event.transition :from => 'address', :to  => 'delivery'
18 18
       next_event.transition :from => 'delivery', :to  => 'payment', :if => :payment_required?
19 19
       next_event.transition :from => 'payment', :to  => 'skrill', :if => lambda {true}
20 20
       next_event.transition :from => 'skrill', :to  => 'complete'
21  
-      next_event.transition :from => 'payment', :to  => 'confirm', :if => Proc.new { Gateway.current && Gateway.current.payment_profiles_supported? }
  21
+      next_event.transition :from => 'payment', :to  => 'confirm', :if => Proc.new { Spree::Gateway.current && Spree::Gateway.current.payment_profiles_supported? }
22 22
       next_event.transition :from => 'payment', :to  => 'complete'
23 23
 
24  
-      Order.state_machine.before_transition :to => 'skrill', :do => Proc.new{ |order|
25  
-        skrill_account = SkrillAccount.find_or_create_by_email(order.email)
  24
+      Spree::Order.state_machine.before_transition :to => 'skrill', :do => Proc.new{ |order|
  25
+        skrill_account = Spree::SkrillAccount.find_or_create_by_email(order.email)
26 26
 
27 27
         payment = order.payment
28 28
         payment.update_attribute(:source, skrill_account)
@@ -38,12 +38,11 @@ def self.activate
38 38
 
39 39
     config.to_prepare &method(:activate).to_proc
40 40
 
41  
-    initializer "spree_skrill.register.payment_methods" do |app|
  41
+    initializer "spree_skrill.register.payment_methods", :after => 'spree.register.payment_methods' do |app|
42 42
       app.config.spree.payment_methods += [
43 43
         Spree::BillingIntegration::Skrill::QuickCheckout
44 44
       ]
45 45
     end
46 46
 
47  
-
48 47
   end
49 48
 end

0 notes on commit 8ffb397

Please sign in to comment.
Something went wrong with that request. Please try again.