iframe.phtml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. /**
  8. * @var \Magento\Payment\Block\Transparent\Iframe $block
  9. */
  10. $params = $block->getParams();
  11. ?>
  12. <html>
  13. <head>
  14. <script>
  15. <?php if (isset($params['redirect'])): ?>
  16. window.location="<?= $block->escapeUrl($params['redirect']) ?>";
  17. <?php elseif (isset($params['redirect_parent'])): ?>
  18. window.top.location="<?= $block->escapeUrl($params['redirect_parent']) ?>";
  19. <?php elseif (isset($params['error_msg'])): ?>
  20. window.top.alert(<?= /* @noEscape */ $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($params['error_msg']) ?>);
  21. <?php elseif (isset($params['order_success'])): ?>
  22. window.top.location = "<?= $block->escapeUrl($params['order_success']) ?>";
  23. <?php else: ?>
  24. var require = window.top.require;
  25. require(['jquery'], function($) {
  26. $('#edit_form').trigger('processStop');
  27. $("input[name='payment[cc_number]']").prop('disabled', true);
  28. $("select[name='payment[cc_type]']").prop('disabled', true);
  29. $("select[name='payment[cc_exp_month]']").prop('disabled', true);
  30. $("select[name='payment[cc_exp_year]']").prop('disabled', true);
  31. $("input[name='payment[cc_cid]']").prop('disabled', true);
  32. $('#edit_form').trigger('realOrder');
  33. });
  34. <?php endif; ?>
  35. </script>
  36. </head>
  37. <body>
  38. </body>
  39. </html>