How Does ‘Payment Failed Email’ Work in Magento

checkoutmagento-2.1transactional-mail

I just read through the documentation for Payment Failed Emails which says:

A notification is sent to the customer if the payment method that is chosen during checkout fails to complete the transaction.

What does this really mean? Is an email sent is during the checkout? Or after the checkout and payment is completed and for some reason, the payment method does not work?

I've just set it up in a sample Magento 2.1.0 and no emails are sent when there are payment errors. Just a brief message saying Unable to place order. Please try again pops up and disappears.

Thanks.

Best Answer

"Unable to place order. Please try again"

mean customer does not enable to create order whenever placing the order from checkout. . This error is created when Customer customer failed place an order.

But, Payment Failed Emails mail is fire when we have called the $this->_objectManager->get('Magento\Checkout\Helper\Data') ->sendPaymentFailedEmail($this->getOnepage()->getQuote(), $e->getMessage())

at checkout/onepage/SaveOrder function.

It is basically called when

error type :

\Magento\Framework\Exception\LocalizedException $e)

\Exception $e

At Magento\Checkout\Controller\Onepage\SaveOrder;

So, this error is generate this two times bascially