pagarme / magento2

Magento2 Module for Pagar.me 2.0
MIT License
4 stars 2 forks source link

Erro no método createInvoice #353

Open abraaomarques opened 3 months ago

abraaomarques commented 3 months ago

Há um erro no método createInvoice da classe: Pagarme\Pagarme\Observer\SalesOrderPlaceAfter

Há um return true logo no início do método:

`public function createInvoice($order) { return true;

    $payment
        ->setIsTransactionClosed(true)
        ->registerCaptureNotification(
            $order->getGrandTotal(),
            true
        );
    $order->save();
    // notify customer
    $invoice = $payment->getCreatedInvoice();
    if ($invoice && !$order->getEmailSent()) {
        $order->addStatusHistoryComment(
                'PGM - ' .
                __(
                    'Notified customer about invoice #%1.',
                    $invoice->getIncrementId()
                )
            )->setIsCustomerNotified(true)
            ->save();
    }

    return true;
}`