mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-04 07:09:14 +00:00
Extract a comment-method so the code conveys it's purpose
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user