From 8016e90e0718e5e2fabee6cc8dc69ca5797d4422 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 20 Dec 2021 18:10:18 +0000 Subject: [PATCH] Ensure payment method is actually selected --- app/controllers/split_checkout_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/split_checkout_controller.rb b/app/controllers/split_checkout_controller.rb index 290ba402fd..5e36409b1c 100644 --- a/app/controllers/split_checkout_controller.rb +++ b/app/controllers/split_checkout_controller.rb @@ -70,7 +70,7 @@ class SplitCheckoutController < ::BaseController end def validate_payment! - return true if params.dig(:order, :payments_attributes).present? + return true if params.dig(:order, :payments_attributes, 0, :payment_method_id).present? @order.errors.add :payment_method, I18n.t('split_checkout.errors.select_a_payment_method') end