mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-08 22:56:06 +00:00
Pull checkout-workflow-related callback methods out into the Checkout module which defines checkout state changes
This commit is contained in:
@@ -613,21 +613,6 @@ module Spree
|
||||
self.email = user.email if user
|
||||
end
|
||||
|
||||
def after_cancel
|
||||
shipments.each(&:cancel!)
|
||||
payments.checkout.each(&:void!)
|
||||
|
||||
OrderMailer.cancel_email(id).deliver_later if send_cancellation_email
|
||||
update(payment_state: updater.update_payment_state)
|
||||
end
|
||||
|
||||
def after_resume
|
||||
shipments.each(&:resume!)
|
||||
payments.void.each(&:resume!)
|
||||
|
||||
update(payment_state: updater.update_payment_state)
|
||||
end
|
||||
|
||||
def use_billing?
|
||||
@use_billing == true || @use_billing == 'true' || @use_billing == '1'
|
||||
end
|
||||
|
||||
@@ -151,6 +151,21 @@ module Spree
|
||||
|
||||
private
|
||||
|
||||
def after_cancel
|
||||
shipments.each(&:cancel!)
|
||||
payments.checkout.each(&:void!)
|
||||
|
||||
OrderMailer.cancel_email(id).deliver_later if send_cancellation_email
|
||||
update(payment_state: updater.update_payment_state)
|
||||
end
|
||||
|
||||
def after_resume
|
||||
shipments.each(&:resume!)
|
||||
payments.void.each(&:resume!)
|
||||
|
||||
update(payment_state: updater.update_payment_state)
|
||||
end
|
||||
|
||||
def validate_payment_method!
|
||||
return unless checkout_processing
|
||||
return if payments.any?
|
||||
|
||||
Reference in New Issue
Block a user