mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Ensure selected shipping method is actually selected
Hashes with symbol keys != hashes with string keys 🙈
This commit is contained in:
@@ -175,7 +175,7 @@ class CheckoutController < ::BaseController
|
||||
return action_failed unless @order.process_payments!
|
||||
end
|
||||
|
||||
next if OrderWorkflow.new(@order).next({ shipping_method_id: shipping_method_id })
|
||||
next if OrderWorkflow.new(@order).next({ "shipping_method_id" => shipping_method_id })
|
||||
|
||||
return action_failed
|
||||
end
|
||||
|
||||
@@ -37,7 +37,7 @@ class OrderWorkflow
|
||||
|
||||
def advance_order_options
|
||||
shipping_method_id = order.shipping_method.id if order.shipping_method.present?
|
||||
{ shipping_method_id: shipping_method_id }
|
||||
{ "shipping_method_id" => shipping_method_id }
|
||||
end
|
||||
|
||||
def advance_to_state(target_state, options = {})
|
||||
@@ -67,7 +67,7 @@ class OrderWorkflow
|
||||
|
||||
def after_transition_hook(options)
|
||||
if order.state == "delivery"
|
||||
order.select_shipping_method(options[:shipping_method_id])
|
||||
order.select_shipping_method(options["shipping_method_id"])
|
||||
end
|
||||
|
||||
persist_all_payments if order.state == "payment"
|
||||
|
||||
Reference in New Issue
Block a user