mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
load exclusively the payment methods that are available on the distributor
This commit is contained in:
@@ -30,8 +30,13 @@ class OrderAvailablePaymentMethods
|
||||
distributor.payment_methods
|
||||
else
|
||||
distributor.payment_methods.where(
|
||||
id: order_cycle.distributor_payment_methods.select(:payment_method_id)
|
||||
id: available_distributor_payment_methods_ids
|
||||
)
|
||||
end.available.select(&:configured?)
|
||||
end
|
||||
|
||||
def available_distributor_payment_methods_ids
|
||||
order_cycle.distributor_payment_methods.where(distributor_id: distributor.id)
|
||||
.select(:payment_method_id)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user