<?php

/**
 * @var \Aman\AmanAccept\Block\Checkout\Success $block
 */


?>

<?php
$renderAman = $block->renderAmanExpress(true);
if ($renderAman == 1): ?>

<style>
.checkout-onepage-success .page-title {
        display: none !important;
}
.checkout-success p
{
	display: none !important;
}
.page-title-wrapper
{
	display: none !important;
}
.actions-toolbar
{
	display: none !important;
}
</style>


<p><strong> <h3><div id= "aman_title"> <?= $block->getAmanExpressTitle() ?> </div> </h3> </strong> </p>

</br>
<div class='instamojo'>
	<div id="aman-payments"></div>
	<div class='errors'>
		<?php if($this->getMessages()): ?>
			<?php foreach($this->getMessages() as $message): ?>
				<div class='alert alert-danger'><p style='color:red'><?= $message ?></p></div>
			<?php endforeach; ?>
			<?php if($this->getShowPhoneBox()): ?>
				<form method='post'>
					<label>Telephone</label><input type='text' name='telephone' value='<?php echo $this->getTelephone() ?>' />
					<div><input type='submit' class='btn btn-primary' value='UPDATE TELEPHONE'></div>
				</form>
			<?php endif; ?>
		<?php else: ?>
			<div id="loading" style="width:200px;margin:auto;margin-top:20px">
				<img style="width:100%" src="<?php echo $block->getViewFileUrl('Aman_AmanAccept::images/spinner.gif'); ?>">
				<div style="text-align: center;">Loading Aman Accept Payment</div>
			</div>
			<form name='amanpaymentredirect' action='<?= $this->getAction() ?>'>
				<input type='hidden' id='embed' name='embed' value='form'>
			</form>
			<script>
			setTimeout(function(){
				getAmanAcceptUrl();
			}, 2000);

			function getAmanAcceptUrl() {
				<?= $block->getAmanAcceptUrl(); ?>
			}

			</script>
		<?php endif; ?>
	</div>

</div>

<?php elseif ($renderAman == 2): ?>

<?php elseif ($renderAman == 3): ?>
	<style>
.checkout-onepage-success .page-title {
        display: none !important;
}
.checkout-success p
{
	display: none !important;
}
.page-title-wrapper
{
	display: none !important;
}
.actions-toolbar
{
	display: none !important;
}
</style>

<p><strong> <h3><div id= "aman_title"> Order cancelled. Please try again later </div> </h3> </strong> </p>

<?php endif; ?>
