diff --git a/app/models/spree/payment.rb b/app/models/spree/payment.rb index 9b3c961e78..46a9d924b3 100644 --- a/app/models/spree/payment.rb +++ b/app/models/spree/payment.rb @@ -41,15 +41,6 @@ module Spree scope :failed, -> { with_state('failed') } scope :valid, -> { where('state NOT IN (?)', %w(failed invalid)) } - after_rollback :persist_invalid - - def persist_invalid - return unless ['failed', 'invalid'].include?(state) - - state_will_change! - save - end - # order state machine (see http://github.com/pluginaweek/state_machine/tree/master for details) state_machine initial: :checkout do # With card payments, happens before purchase or authorization happens diff --git a/app/models/spree/payment_decorator.rb b/app/models/spree/payment_decorator.rb deleted file mode 100644 index f79529e306..0000000000 --- a/app/models/spree/payment_decorator.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'spree/localized_number' - -module Spree - Payment.class_eval do - # We bypass this after_rollback callback that is setup in Spree::Payment - # The issues the callback fixes are not experienced in OFN: - # if a payment fails on checkout the state "failed" is persisted correctly - def persist_invalid; end - end -end