get payment method code magento 2 code example Example: magento 2 get payment method name $payment = $order->getPayment()->getMethodInstance()->getTitle();