Conditions | 3 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function getPaymentMethodsForOrder(Order $order): Collection |
||
19 | { |
||
20 | $collection = new ArrayCollection(); |
||
21 | |||
22 | if ($order->getShippingMethod() instanceof ShippingMethod) { |
||
23 | $collection = $order->getShippingMethod()->getPaymentMethods(); |
||
24 | $collection = $collection->filter(function (PaymentMethod $paymentMethod) use ($order) { |
||
25 | return $paymentMethod->isEnabled() && $this->isPaymentMethodAvailableForOrder($paymentMethod, $order); |
||
26 | }); |
||
27 | } |
||
28 | |||
29 | return $collection; |
||
30 | } |
||
31 | |||
45 |