diff --git a/Helper/Transaction.php b/Helper/Transaction.php index 1883d07..55ebf0a 100644 --- a/Helper/Transaction.php +++ b/Helper/Transaction.php @@ -33,17 +33,11 @@ class Transaction extends \Magento\Framework\App\Helper\AbstractHelper */ private $orderRepository; - /** - * @var \Magento\Sales\Model\Order\Email\Sender\InvoiceSender - */ - private $invoiceSender; - /** * @param \Mygento\Payment\Helper\Data $helper * @param \Magento\Sales\Model\Order\Payment\Transaction\ManagerInterface $transactionManager * @param \Magento\Sales\Api\TransactionRepositoryInterface $transactionRepo * @param \Magento\Sales\Api\OrderRepositoryInterface $orderRepository - * @param \Magento\Sales\Model\Order\Email\Sender\InvoiceSender $invoiceSender * @param \Magento\Framework\App\Helper\Context $context */ public function __construct( @@ -51,7 +45,6 @@ public function __construct( \Magento\Sales\Model\Order\Payment\Transaction\ManagerInterface $transactionManager, \Magento\Sales\Api\TransactionRepositoryInterface $transactionRepo, \Magento\Sales\Api\OrderRepositoryInterface $orderRepository, - \Magento\Sales\Model\Order\Email\Sender\InvoiceSender $invoiceSender, \Magento\Framework\App\Helper\Context $context ) { parent::__construct($context); @@ -59,7 +52,6 @@ public function __construct( $this->transactionRepo = $transactionRepo; $this->transactionManager = $transactionManager; $this->orderRepository = $orderRepository; - $this->invoiceSender = $invoiceSender; } /** @@ -95,6 +87,8 @@ public function proceedAuthorize($order, $transactionId, $amount, $transData = [ * @param string $transactionId * @param float $amount * @param array $transData + * + * @return \Magento\Sales\Api\Data\OrderPaymentInterface */ public function proceedCapture($order, $transactionId, $amount, $transData = []) { @@ -116,14 +110,8 @@ public function proceedCapture($order, $transactionId, $amount, $transData = []) $transData ); } - $invoice = $payment->getCreatedInvoice(); - if ($invoice && !$invoice->getEmailSent()) { - $this->invoiceSender->send($invoice); - $order->addStatusHistoryComment( - __('You notified customer about invoice #%1.', $invoice->getIncrementId()) - ) - ->save(); - } + + return $payment; } /**