mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Extract #set_payment_amount method
This commit is contained in:
@@ -146,14 +146,17 @@ class SplitCheckoutController < ::BaseController
|
||||
payments_attributes: [:payment_method_id]
|
||||
)
|
||||
|
||||
if @order_params[:payments_attributes]
|
||||
# Set payment amount
|
||||
@order_params[:payments_attributes].first[:amount] = @order.total
|
||||
end
|
||||
set_payment_amount
|
||||
|
||||
@order_params
|
||||
end
|
||||
|
||||
def set_payment_amount
|
||||
return unless @order_params[:payments_attributes]
|
||||
|
||||
@order_params[:payments_attributes].first[:amount] = @order.total
|
||||
end
|
||||
|
||||
def redirect_to_step
|
||||
case @order.state
|
||||
when "cart", "address", "delivery"
|
||||
|
||||
Reference in New Issue
Block a user