| 1 |
<?php |
| 2 |
/** |
| 3 |
* Receipt page for seQura payment gateway. |
| 4 |
* |
| 5 |
* @package SeQura/WC |
| 6 |
* @var array<string, string> $args The arguments. Must contain: |
| 7 |
* - string 'form' The identification form HTML code. |
| 8 |
*/ |
| 9 |
|
| 10 |
defined( 'WPINC' ) || die; |
| 11 |
|
| 12 |
if ( empty( $args['form'] ) ) { |
| 13 |
return; |
| 14 |
} |
| 15 |
|
| 16 |
?> |
| 17 |
<p><?php echo wp_kses_post( __( 'Thank you for your order. Please fill the required data to pay with seQura...', 'sequra' ) ); ?></p> |
| 18 |
<?php |
| 19 |
echo wp_kses( |
| 20 |
$args['form'], |
| 21 |
array( |
| 22 |
'iframe' => array( |
| 23 |
'id' => array(), |
| 24 |
'name' => array(), |
| 25 |
'class' => array(), |
| 26 |
'src' => array(), |
| 27 |
'frameborder' => array(), |
| 28 |
'style' => array(), |
| 29 |
'type' => array(), |
| 30 |
), |
| 31 |
'script' => array( |
| 32 |
'type' => array(), |
| 33 |
'src' => array(), |
| 34 |
), |
| 35 |
), |
| 36 |
array( 'https' ) |
| 37 |
); |
| 38 |
?> |
| 39 |
<script type="text/javascript"> |
| 40 |
(function(){ |
| 41 |
const tryToShowForm = () => { |
| 42 |
try { |
| 43 |
window.SequraFormInstance.setCloseCallback(function () { |
| 44 |
document.location.href = '<?php echo esc_js( wc_get_checkout_url() ); ?>'; |
| 45 |
}); |
| 46 |
window.SequraFormInstance.show(); |
| 47 |
const iframe = document.querySelector('.sq-identification-iframe'); |
| 48 |
document.body.append(iframe); |
| 49 |
} catch (e) { |
| 50 |
setTimeout(tryToShowForm, 100); |
| 51 |
} |
| 52 |
}; |
| 53 |
document.addEventListener("DOMContentLoaded", tryToShowForm); |
| 54 |
})(); |
| 55 |
</script> |