As pre_option_woocommerce_default_gateway
hook doesn't exist anymore, you can also try the following, that will reset the chosen payment gateway to the first displayed payment method:
add_action( 'wp_footer', 'default_payment_gateway' );
function default_payment_gateway() {
if( is_checkout() && ! is_wc_endpoint_url() ) :
$available_gateways = WC()->payment_gateways->get_available_payment_gateways();
$available_gateways_ids = array_keys($available_gateways);
$default_gateway_id = reset($available_gateways_ids);
?>
<script language="javascript">
jQuery( function($){
var a = '<?php echo $default_gateway_id; ?>',
b = 'input[name="payment_method"][value="'+a+'"]';
$(b).prop('checked', true);
$(document.body).trigger('update_checkout');
});
</script>
<?php
endif;
}
Code goes in functions.php file of your active child theme (or active theme). Works on all WooCommerce versions since 2.5.x.
Or you can set a default specific payment method, replacing:
$available_gateways = WC()->payment_gateways->get_available_payment_gateways();
$available_gateways_ids = array_keys($available_gateways);
$default_gateway_id = reset($available_gateways_ids);
by (here "COD" for example):
$default_gateway_id = 'cod';
Anyways, on radio buttons, the default behavior is always to display the first item as checked. To have all radio buttons unchecked is something unusual.