<?php
/**
 * Page Template
 *
 * Loaded automatically by index.php?main_page=checkout_success.<br />
 * Displays confirmation details after order has been successfully processed.
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 */
?>

<div class="centerColumn" id="checkoutStripepay">
<div id="loading" style="min-height: 150px;width:100%;background: url(includes/modules/payment/m_stripe/loading.gif) no-repeat center 60px;"></div>
<iframe  name='qstripeiframe' style='min-height: 500px;'  margin='0' width='100%;'  height='100%'  frameborder='no' border='0' marginwidth='0' marginheight='0' scrolling='no' allowtransparency='yes' id='csiteframe'></iframe>
	<form target="qstripeiframe" action="<?php echo $redirect_url ?>" id="stripe_checkout" method="POST">
		<input type="hidden" name="orders_id" value="<?php echo $orders_id?>" />
		<input type="hidden" name="fetch_url" value="<?php echo $fetch_url?>" />
		<input type="hidden" name="callback_url" value="<?php echo $callback_url?>" />
		
	</form>
    <script type="text/javascript">document.getElementById("stripe_checkout").submit();</script>	
	<script>
	window.addEventListener('message', receiveMessage, false);
		function receiveMessage(event)
		{
								
			if(event.data=='succeeded')
			{
				window.location.href="<?php echo $success_url ?>";
			}
			else if(event.data=='loadinged')
			{
				document.getElementById("loading").style.display="none";
			}	
			
		}
</script>

</div>