Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ValidatorCanInvoice.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
8 namespace Magento\Paypal\Plugin;
9 
14 
20 {
24  private $express;
25 
31  public function __construct(Express $express)
32  {
33  $this->express = $express;
34  }
35 
46  public function afterValidate(CanInvoice $subject, array $result, OrderInterface $order): array
47  {
48  if ($this->express->isOrderAuthorizationAllowed($order->getPayment())) {
49  $result[] = __('An invoice cannot be created when none of authorization transactions available.');
50  }
51 
52  return $result;
53  }
54 }
afterValidate(CanInvoice $subject, array $result, OrderInterface $order)
$order
Definition: order.php:55
__()
Definition: __.php:13