Extract a comment-method so the code conveys it's purpose

This commit is contained in:
Matt-Yorkley
2022-02-15 12:17:08 +00:00
parent b017420319
commit 8084ad0068

View File

@@ -147,7 +147,7 @@ module Spree
adjustment.originator = payment_method
adjustment.label = adjustment_label
adjustment.save
elsif amount.positive? && payment_method.present?
elsif !processing_refund? && payment_method.present?
payment_method.create_adjustment(adjustment_label, self, true)
adjustment.reload
end
@@ -163,6 +163,10 @@ module Spree
private
def processing_refund?
amount.negative?
end
# Don't charge fees for invalid or failed payments.
# This is called twice for failed payments, because the persistence of the 'failed'
# state is acheived through some trickery using an after_rollback callback on the