From 5506cc86d29dfea20744a0a2581d91b783fb4144 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Wed, 11 Mar 2020 13:07:38 +0000 Subject: [PATCH] Bypass after_rollback callback in payment This is causing several specs to fail on rollback and, according to some manual testing (and all the auto tests we have), we dont need this fix in OFN --- app/models/spree/payment_decorator.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/models/spree/payment_decorator.rb b/app/models/spree/payment_decorator.rb index ed3c85233c..69f4170f19 100644 --- a/app/models/spree/payment_decorator.rb +++ b/app/models/spree/payment_decorator.rb @@ -12,6 +12,13 @@ module Spree localize_number :amount + # 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 + return + end + def ensure_correct_adjustment revoke_adjustment_eligibility if ['failed', 'invalid'].include?(state) return if adjustment.try(:finalized?)