customer order – magento 2.3.1 how to redirect to a failed page if the credit card information is wrong or if an error occurs

I have integrated payment method available in version 2.3.1 of Magento that uses the Accept.js method.

When the customer gives erroneous information on his credit card or any error that gives in response, he is then redirected to a failure page and the order placed with the status Payment_review.

How to implement this feature in version 2.3.1 of Magento?

Hiren Shah