Merge pull request #4974 from luisramos0/payment_rollback

[Spree 2.1] Bypass broken payment rollback callback
This commit is contained in:
Pau Pérez Fabregat
2020-03-17 15:37:28 +01:00
committed by GitHub

View File

@@ -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?)