There is an alternative method to load Snap UI page instead of calling snap.js, which is window redirection.
Merchants can utilize the response value in
redirect_url from the Create Snap Token request. Merchants don't have to load snap.js in their page, as the user is redirected to a page that is hosted by Midtrans.
With this redirection merchant can load Snap page in full window mode view like this:
It is possible to track status to be used to trigger your own custom events even for Window Redirection Method. You can do so by listening to URL changes and capture the query parameters appended to the finish URL. You can define after payment's finish & error URL by going to Dashboard > Configurations.
Merchant URL: https://merchant-callback.com