diff --git a/app/controllers/spree/checkout_controller_decorator.rb b/app/controllers/spree/checkout_controller_decorator.rb index b9eac5a..4cb9807 100644 --- a/app/controllers/spree/checkout_controller_decorator.rb +++ b/app/controllers/spree/checkout_controller_decorator.rb @@ -147,7 +147,7 @@ module Spree @order.update_attribute(:state, "complete") state_callback(:after) # So that after_complete is called, setting session[:order_id] to nil - @order.send(:consume_users_credit) #since we dont rely on state machine callback, we just explicitly call this method for spree_store_credits + @order.send(:consume_users_credit) if @order.respond_to?(:consume_users_credit)#since we dont rely on state machine callback, we just explicitly call this method for spree_store_credits @order.finalize! flash[:notice] = I18n.t(:order_processed_successfully) diff --git a/app/views/spree/shared/paypal_express_confirm.html.erb b/app/views/spree/shared/paypal_express_confirm.html.erb index 879fb42..d7839f9 100644 --- a/app/views/spree/shared/paypal_express_confirm.html.erb +++ b/app/views/spree/shared/paypal_express_confirm.html.erb @@ -3,8 +3,23 @@ <%= raw t("order_not_yet_placed") %>

-<%= render :partial => 'spree/shared/order_details', :locals => {:order => @order} -%> -
- <%= button_to t('place_order'), paypal_finish_order_checkout_url(@order, {:token => params[:token] , :PayerID => params[:PayerID], :payment_method_id => - params[:payment_method_id] } ), :class => "button primary" %> + + +
+ <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @order } %> + +
+

<%= t(:checkout) %>

+
<%= checkout_progress %>
+
+ +
+
+ <%= render :partial => 'spree/shared/order_details', :locals => {:order => @order} -%> +
+ <%= button_to t('place_order'), paypal_finish_order_checkout_url(@order, {:token => params[:token] , :PayerID => params[:PayerID], :payment_method_id => + params[:payment_method_id] } ), :class => "button primary" %> +
+
+
diff --git a/spec/controllers/checkout_controller_spec.rb b/spec/controllers/checkout_controller_spec.rb index e559811..12bcc17 100644 --- a/spec/controllers/checkout_controller_spec.rb +++ b/spec/controllers/checkout_controller_spec.rb @@ -2,8 +2,10 @@ require File.dirname(__FILE__) + '/../spec_helper' module Spree describe CheckoutController do + render_views let(:token) { "EC-2OPN7UJGFWK9OYFV" } - let(:order) { Factory(:ppx_order_with_totals, :state => "payment") } + let(:order) { Factory(:ppx_order_with_totals, :state => "payment", :shipping_method => shipping_method) } + let(:shipping_method) { FactoryGirl.create(:shipping_method, :zone => Spree::Zone.find_by_name('North America')) } let(:order_total) { (order.total * 100).to_i } let(:gateway_provider) { mock(ActiveMerchant::Billing::PaypalExpressGateway) } let(:paypal_gateway) { mock(BillingIntegration::PaypalExpress, :id => 123, :preferred_review => false, :preferred_no_shipping => true, :provider => gateway_provider, :preferred_currency => "US", :preferred_allow_guest_checkout => true