I want to make some changes if the chosen payment method is COD. On existing WC_Order i have used
($order->payment_method_title == \'Cash On Delivery\' ? ...
If you need the payment gateway object itself you can use the wc_get_payment_gateway_by_order function.
wc_get_payment_gateway_by_order
$payment_gateway = wc_get_payment_gateway_by_order( $order );