I have website in PHP.And my situation is that I have checkout page that I need to click on submit button for payment process in iframe window. After complete payment process, I need to close iframe window and redirect to success page.But iframe did not close and page redirected into iframe.
Code look like this:
<form><input type="button" name="payfort" value="Continue" onclick="CreditPay();" id="payfort" class="payfort" /></form>
<script type="text/javascript">
function CreditPay() {
var pop = document.getElementById('popup-win');
pop.style.display = 'block';
document.getElementById('overlay').className = 'show';
document.getElementById('payfortForm').submit();
return false;
}</script>
And below code is open in iframe:
<div class="popup-win" id="popup-win" style="display: none;">
<div class="popup-header">
</div>
<div class="popup-subtitle">
Transaction Value:<span class='currency-txt'>AED 17.00</span>
</div>
<iframe id="ifrmPAYFORT" name="ifrmPAYFORT" style="width: 100%; height: 450px"></iframe></div>
<div class="overlay" id="overlay"></div>
<form METHOD="post" ACTION="http://localhost/phppayfort/success.php" id="payfortForm" name="payfortForm" target="ifrmPAYFORT">
<input type="hidden" name="service_command" value="<?php echo $requestParams['service_command'] ?>">
<input type="hidden" name="language" value="<?php echo $requestParams['language'] ?>">
<input type="hidden" name="merchant_identifier" value="<?php echo $requestParams['merchant_identifier'] ?>">
<input type="hidden" name="access_code" value="<?php echo $requestParams['access_code'] ?>">
<input type="hidden" name="signature" value="<?php echo $signature ?>">
<input type="hidden" name="return_url" value="<?php echo $requestParams['return_url'] ?>">
<input type="hidden" name="merchant_reference" value="<?php echo $requestParams['merchant_reference'] ?>">
</form>
So, is there any way to close iframe window on reload page?
Many thanks in advance for recommendations.