mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Extract CableCar responses code to a concern
This commit is contained in:
15
app/controllers/concerns/cablecar_responses.rb
Normal file
15
app/controllers/concerns/cablecar_responses.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module CablecarResponses
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
include CableReady::Broadcaster
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def partial(path, options = {})
|
||||
{ html: render_to_string(partial: path, **options) }
|
||||
end
|
||||
end
|
||||
@@ -8,7 +8,7 @@ class SplitCheckoutController < ::BaseController
|
||||
include OrderStockCheck
|
||||
include Spree::BaseHelper
|
||||
include CheckoutCallbacks
|
||||
include CableReady::Broadcaster
|
||||
include CablecarResponses
|
||||
|
||||
helper 'terms_and_conditions'
|
||||
helper 'checkout'
|
||||
@@ -36,10 +36,6 @@ class SplitCheckoutController < ::BaseController
|
||||
|
||||
private
|
||||
|
||||
def partial(path, options = {})
|
||||
{ html: render_to_string(partial: path, **options) }
|
||||
end
|
||||
|
||||
def clear_invalid_payments
|
||||
@order.payments.with_state(:invalid).delete_all
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user