<?php
$parameters = $block->getData('redirect_fields');
$redirectURL = $parameters['RedirectURL'];
$merchantID = $parameters['MerchantID'];
$amount = $parameters['Amount'];
$currencyCode = $parameters['CurrencyISOCode'];
$language = $parameters['Language'];
$messageID = $parameters['MessageID'];
$transactionID = $parameters['TransactionID'];
$themeID = $parameters['ThemeID'];
$responseBackURL = $parameters['ResponseBackURL'];
$quantity = $parameters['Quantity'];
$channel = $parameters['Channel'];
$secureHash = $parameters['SecureHash'];
$version = $parameters['Version'];
$ItemID = $parameters['ItemID'];
$lang = $block->getData('lang');
?>

<div class="smartroute-cont-<?= $lang ?>">
    <center>
        <b><?= __('You Will Be Redirected To SmartRoute In Few Seconds') ?>…</b> 
    </center>
    <form  action="<?= $redirectURL ?>"  method="post" name="redirectForm">
        <input name="MerchantID" type="hidden" value="<?= $merchantID ?>"/>
        <input name="Amount" type="hidden" value="<?= $amount ?>"/>
        <input name="CurrencyISOCode" type="hidden" value="<?= $currencyCode ?>"/>
        <input name="Language" type="hidden" value="<?= $language ?>"/>
        <input name="MessageID" type="hidden" value="<?= $messageID ?>"/>
        <input name="TransactionID" type="hidden" value="<?= $transactionID ?>"/>
        <input name="ThemeID" type="hidden" value="<?= $themeID ?>"/>
        <input name="ResponseBackURL" type="hidden" value="<?= $responseBackURL ?>"/>
        <input name="Quantity" type="hidden" value="<?= $quantity ?>"/>
        <input name="Channel" type="hidden" value="<?= $channel ?>"/>
        <input name="Version" type="hidden" value="<?= $version ?>"/>
        <input name="SecureHash" type="hidden" value="<?= $secureHash ?>"/>

        <?php if (!empty($ItemID)): ?>
            <input name="ItemID" type="hidden" value="<?= $ItemID ?>"/>
        <?php endif; ?>

    </form>
    <script type="text/javascript">
        setTimeout(function () {
            document.redirectForm.submit();
        }, 2000);
    </script>
</div> 