Ensure payment method is actually selected

This commit is contained in:
Matt-Yorkley
2021-12-20 18:10:18 +00:00
parent dd23e3d38a
commit 8016e90e07

View File

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