<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/**
 * @var $block \Magento\Authorizenet\Block\Transparent\Iframe
 */
$params = $block->getParams();
$helper = $block->getHelper('adminhtml');
?>
<html>
    <head>
        <script>
        <?php if (isset($params['redirect'])): ?>
            window.location="<?= $block->escapeUrl($params['redirect']) ?>";
        <?php endif; ?>
        <?php if (isset($params['redirect_parent'])): ?>
            window.top.location="<?= $block->escapeUrl($params['redirect_parent']) ?>";
        <?php endif; ?>
        <?php if (isset($params['error_msg'])): ?>
            window.top.directPostModel.showError(<?= /* @noEscape */ json_encode((array)$params['error_msg']) ?>);
            <?php if (isset($params['x_invoice_num'])): ?>
                window.top.directPostModel.successUrl="<?= $block->escapeUrl($helper->getSuccessOrderUrl($params)) ?>";
            <?php endif; ?>
        <?php endif; ?>
        </script>
    </head>
    <body></body>
</html>
