public function aroundCapture(
        \Magento\Sales\Model\Order\Payment\Processor $subject,
        \Closure $proceed,
        \Magento\Sales\Api\Data\OrderPaymentInterface $payment,
        \Magento\Sales\Api\Data\InvoiceInterface $invoice = null
    ) {
        if ($invoice) {
            /* try to find related record in quote registry */
            $order = $payment->getOrder();
            $quoteId = $order->getQuoteId();
            $found = $this->daoPartialQuote->getById($quoteId);
            if ($found) {
                /* decrease amount in invoice */
                $partialBase = $found->getBasePartialAmount();
                $partial = $found->getPartialAmount();
                $grandTotalBase = $invoice->getBaseGrandTotal();
                $grandTotal = $invoice->getGrandTotal();
                $grandTotalBase -= $partialBase;
                $grandTotal -= $partial;
                $invoice->setBaseGrandTotal($grandTotalBase);
                $invoice->setGrandTotal($grandTotal);
            }
        }
        $result = $proceed($payment, $invoice);
        return $result;
    }