Hi,
You're on the right track. The problem is that the messages you add from a popup with enqueueMessage is that it's the popup that is displaying the messages, but since HikaShop stops the processing in the popup to close it, you're not seeing them.
And even if you reload the page manually, that won't change.
What I would recommend is for you to like this:
if($_REQUEST['tmpl']=='component') {
echo hikashop_display('My error message', 'error');
exit;
}
That will halt the process in the popup and display your error message in the popup.
If the payment capture is successful, then I would recommend to have that code in onAfterOrderUpdate:
if($_REQUEST['tmpl']=='component' && $this->payment_success) {
echo hikashop_display('My success message', 'success');
exit;
}
Doing it like that will prevent HikaShop from closing the popup and will display the message through HikaShop's message display system which works even when the process of the page is stopped, which joomla's doesn't.