diff --git a/app/controllers/payment_gateways/stripe_controller.rb b/app/controllers/payment_gateways/stripe_controller.rb index 121c8f7d6b..cb9331f3da 100644 --- a/app/controllers/payment_gateways/stripe_controller.rb +++ b/app/controllers/payment_gateways/stripe_controller.rb @@ -33,7 +33,7 @@ module PaymentGateways require_order_authentication! session[:access_token] ||= params[:order_token] - @order = Spree::Order.find_by(number: params[:id]) || current_order + @order = Spree::Order.find_by(number: params[:order_number]) || current_order if @order authorize! :edit, @order, session[:access_token] diff --git a/config/routes.rb b/config/routes.rb index 84c1f1d370..152b9c1435 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -75,7 +75,7 @@ Openfoodnetwork::Application.routes.draw do get "/paypal/cancel", to: "paypal#cancel", as: :cancel_paypal get "/stripe/confirm", to: "stripe#confirm", as: :confirm_stripe - get "/stripe/authorize", to: "stripe#authorize", as: :authorize_stripe + get "/stripe/authorize/:order_number", to: "stripe#authorize", as: :authorize_stripe end constraints SplitCheckoutConstraint.new do