Just change the Payment Method
How to Setup Snippet
Direct Bank Transfer (bacs), Check payments (cheque), Cash on Delivery (cod), and PayPal (Paypal). Depending on which payment method you are specifying the condition for, you would need to use the appropriate ID e.g. “bacs”, “cheque”, “cod”, “paypal”.
add_action('woocommerce_order_status_changed', 'ts_auto_complete_by_payment_method');
function ts_auto_complete_by_payment_method($order_id)
{
if ( ! $order_id ) {
return;
}
global $product;
$order = wc_get_order( $order_id );
if ($order->data['status'] == 'processing') {
$payment_method=$order->get_payment_method();
if ($payment_method!="cod") // Change the Payment Method
{
$order->update_status( 'completed' );
}
}
}