Ensure selected shipping method is actually selected

Hashes with symbol keys != hashes with string keys 🙈
This commit is contained in:
Matt-Yorkley
2021-09-06 20:27:10 +01:00
parent fb7a3a681b
commit 3bcfc673f7
2 changed files with 3 additions and 3 deletions

View File

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

View File

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