Clarify params

Spree::Order.to_param outputs the order *number* (not the id) when used to build URLs. This makes it a bit more explicit.
This commit is contained in:
Matt-Yorkley
2021-12-31 14:25:47 +00:00
parent 12f7fc98fa
commit c209be9c17
2 changed files with 2 additions and 2 deletions

View File

@@ -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]

View File

@@ -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