I creating 1 new payment gateway module which works fine but in that module I need to call some api and postProcess() is called I need show message from api if from some reasons my api gives an error.
I'm using exception for now but it shows totally different page with error so I decided to handle it with error code like this :
But it also looks like exception error. I want that message to show with cart. like small red message strip on top of the cart.
if(!isset($paymentData['paymentUrl']))
{
$this->errors[] = Tools::displayError('Please enter valid mobile number');
}