Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CanVoidHandler.php
Go to the documentation of this file.
1 <?php
7 
11 
13 {
17  private $subjectReader;
18 
23  public function __construct(
24  SubjectReader $subjectReader
25  ) {
26  $this->subjectReader = $subjectReader;
27  }
28 
38  public function handle(array $subject, $storeId = null)
39  {
40  $paymentDO = $this->subjectReader->readPayment($subject);
41 
42  $payment = $paymentDO->getPayment();
43  return $payment instanceof Payment && !(bool)$payment->getAmountPaid();
44  }
45 }
$payment
Definition: order.php:17