More namespacing

This commit is contained in:
John Dyer 2011-12-07 17:00:27 -05:00
parent 508461dbc7
commit 6e6b553313
2 changed files with 314 additions and 313 deletions

View File

@ -1,4 +1,5 @@
Spree::CheckoutController.class_eval do
module Spree
CheckoutController.class_eval do
before_filter :redirect_to_paypal_express_form_if_needed, :only => [:update]
def paypal_checkout
@ -60,7 +61,7 @@ Spree::CheckoutController.class_eval do
if @ppx_details.success?
# now save the updated order info
PaypalAccount.create(:email => @ppx_details.params["payer"],
Spree::PaypalAccount.create(:email => @ppx_details.params["payer"],
:payer_id => @ppx_details.params["payer_id"],
:payer_country => @ppx_details.params["payer_country"],
:payer_status => @ppx_details.params["payer_status"])
@ -121,7 +122,7 @@ Spree::CheckoutController.class_eval do
ppx_auth_response = gateway.authorize((@order.total*100).to_i, opts)
end
paypal_account = PaypalAccount.find_by_payer_id(params[:PayerID])
paypal_account = Spree::PaypalAccount.find_by_payer_id(params[:PayerID])
payment = @order.payments.create(
:amount => ppx_auth_response.params["gross_amount"].to_f,
@ -364,5 +365,5 @@ Spree::CheckoutController.class_eval do
payment_method.provider
end
end
end

View File

@ -1,4 +1,4 @@
class PaypalAccount < ActiveRecord::Base
class Spree::PaypalAccount < ActiveRecord::Base
has_many :payments, :as => :source
def actions