Skip to content

Commit

Permalink
Fix missing checkout_state_path
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt-Yorkley authored and abdellani committed Jun 5, 2023
1 parent a1c6fbb commit 32b8d72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/controllers/payment_gateways/paypal_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ def express
flash[:error] =
Spree.t('flash.generic_error', scope: 'paypal',
reasons: pp_response.errors.map(&:long_message).join(" "))
redirect_to main_app.checkout_state_path(:payment)
redirect_to main_app.checkout_step_path(:payment)
end
rescue SocketError
flash[:error] = Spree.t('flash.connection_failed', scope: 'paypal')
redirect_to main_app.checkout_state_path(:payment)
redirect_to main_app.checkout_step_path(:payment)
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/spree/orders_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def update
format.html do
if params.key?(:checkout)
@order.next_transition.run_callbacks if @order.cart?
redirect_to main_app.checkout_state_path(@order.checkout_steps.first)
redirect_to main_app.checkout_step_path(@order.checkout_steps.first)
elsif @order.complete?
redirect_to main_app.order_path(@order)
else
Expand Down
8 changes: 4 additions & 4 deletions spec/controllers/payment_gateways/paypal_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ module PaymentGateways
context "when processing fails" do
let(:response) { false }

it "redirects to checkout_state_path with a flash error" do
expect(post(:express)).to redirect_to checkout_state_path(:payment)
it "redirects to checkout_step_path with a flash error" do
expect(post(:express)).to redirect_to checkout_step_path(:payment)
expect(flash[:error]).to eq "PayPal failed. "
end
end
Expand All @@ -99,8 +99,8 @@ module PaymentGateways
allow(response_mock).to receive(:success?).and_raise(SocketError)
end

it "redirects to checkout_state_path with a flash error" do
expect(post(:express)).to redirect_to checkout_state_path(:payment)
it "redirects to checkout_step_path with a flash error" do
expect(post(:express)).to redirect_to checkout_step_path(:payment)
expect(flash[:error]).to eq "Could not connect to PayPal."
end
end
Expand Down

0 comments on commit 32b8d72

Please sign in to comment.