In Magento 2, I am using brain-tree credit card payment method on live site. Sometimes it shows error,
unable to place an order, please try after sometimes
but I want to know exact error on front end side about that transaction declined. I want error handling for Braintree credit card payment so that it makes easy to know the reason behind failed payment.
Magento – Magento 2.1 braintree credit card error handling
magento2payment-gateway
Best Answer
As far as I know, Magento 2 use Ajax to handle this task.
We should take a look at file:
vendor/magento/module-checkout/view/frontend/web/js/model/place-order.js
So, we need to override this file or the
errorProcessor.process()
-vendor/magento/module-checkout/view/frontend/web/js/model/error-processor.js
handler. We can alert the error message.