Magento 2 Identify Payment method is offline or online after place order.

Magento 2 you can identify Payment method was offline or online for a placed order. Sometimes you need to identify Used payment method in Order was offline or online.

Offline Payment methods are Cash on delivery, Check/Money order, Bank transfer.

Online Payment methods are Paypal,, Cybersource, Braintree and many more online payments available.

You can check payment method is offline or online using programmatically by

$order->getPayment()->getMethodInstance()->isOffline() result will be 1 for offline payment method.

I have given demo for Observer. Event name is sales_order_place_after,