mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-27 21:06:49 +00:00
This will let us branch by abstraction. All existing calls to `#outstanding_balance` will go through `OrderBalance` hence, will check the feature toggle. Note that by default, `OrderBalance` will end up calling `#old_outstanding_balance`. As the name states, that's exactly what `#outstanding_balance` was so far. This means no consumers will see any change in behavior. We just added on item in the call stack (sort of).
12 lines
238 B
Ruby
12 lines
238 B
Ruby
# frozen_string_literal: true
|
|
|
|
module OrderHelper
|
|
def last_payment_method(order)
|
|
OrderPaymentFinder.new(order).last_payment&.payment_method
|
|
end
|
|
|
|
def outstanding_balance_label(order)
|
|
order.outstanding_balance.label
|
|
end
|
|
end
|