Refresh checkout when change payment
Refresh the checkout process when changing the payment method.
add_action('woocommerce_review_order_before_payment', function(){
if (!is_cart()) {
?>
<script type="text/javascript">
(function ($) {
$('form.checkout').on('change', '.shipping_method', function () {
$('body').trigger('update_checkout');
location.reload();
});
})(jQuery);
</script>
<?php
}
});