magento2 – Payment errors in modal?

How can I trigger a popup modal to display the error, when a card is denied or and an AVS error?

Payment errors appear to be defined in the file below

app / design / frontend / YOUR / TEMPLATE / Magento_Payment / templates / transparent / iframe.phtml in this section.


            
            
            
            var require = window.top.require;
require(
                [
                    'jquery',
                    'Magento_Ui/js/model/messageList',
                    'mage/translate',
                    'Magento_Checkout/js/model/full-screen-loader'
                ],
function ($, globalMessageList, $ t, fullScreenLoader) {
var parent = window.top;
$ (parent) .trigger (& # 39; clearTimeout & # 39;);
fullScreenLoader.stopLoader ();
globalMessageList.addErrorMessage ({
message: $ t ()
});
}
)

I'm trying to understand how to convey / trigger the error in a contextual modal because most people do not see the error message, and on a mobile it's almost impossible to see before that the message does not disappear.

I've managed to make the message last longer, but a contextual modal would be ideal, but I have not figured out how to implement it yet.

On GitHub, there is mention of the use of modal, but no code to do it.

This is for Authorize.net on 2.2.8

How can I trigger a popup modal to display the error, when a card is denied or and an AVS error?

The error message may be static, but would be better if the message was in the modal. I had already asked the question before, but I can confirm, this can be done via GitHub messages on the same subject.