express = $express; } /** * Checks a possibility to invoice of PayPal Express payments when payment action is "order". * * @param CanInvoice $subject * @param array $result * @param OrderInterface $order * @return array * @throws LocalizedException * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterValidate(CanInvoice $subject, array $result, OrderInterface $order): array { if ($this->express->isOrderAuthorizationAllowed($order->getPayment())) { $result[] = __('An invoice cannot be created when none of authorization transactions available.'); } return $result; } }