mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Update payment methods form
This commit is contained in:
@@ -81,7 +81,8 @@ class SplitCheckoutController < ::BaseController
|
||||
params.require(:order).permit(
|
||||
:email, :shipping_method_id, :special_instructions,
|
||||
bill_address_attributes: PermittedAttributes::Address.attributes,
|
||||
ship_address_attributes: PermittedAttributes::Address.attributes
|
||||
ship_address_attributes: PermittedAttributes::Address.attributes,
|
||||
payments_attributes: [:payment_method_id]
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
%div.checkout-substep{"data": {"controller": "paymentmethod"}}
|
||||
%div.checkout-substep{"data-controller": "paymentmethod"}
|
||||
%div.checkout-title
|
||||
= t("split_checkout.step2.payment_method.title")
|
||||
- selected_payment_method = @order.payments&.with_state(:checkout)&.first&.payment_method_id
|
||||
- available_payment_methods.each do |payment_method|
|
||||
%div.checkout-input
|
||||
= f.radio_button :payment_method_id, payment_method.id,
|
||||
name: "order[payments_attributes][][payment_method_id]",
|
||||
id: "payment_method_#{payment_method.id}",
|
||||
name: "order[payments_attributes][][payment_method_id]",
|
||||
checked: (payment_method.id == selected_payment_method),
|
||||
"data-action": "paymentmethod#selectPaymentMethod",
|
||||
"data-paymentmethod-description": "#{payment_method.description}"
|
||||
= f.label payment_method.id, "#{payment_method.name} (#{payment_method_price(payment_method, @order)})", {for: "payment_method_" + payment_method.id.to_s }
|
||||
|
||||
Reference in New Issue
Block a user