How do I get information about the payment method from the order object programmatically?
The Commerce Payment module adds the payment_method base field when it is enabled, see commerce_payment_entity_base_field_info https://github.com/drupalcommerce/commerce/blob/8.x-2.x/modules/payment/commerce_payment.module#L28

You can access the payment method (and gateway) through

$order-&gt;get('payment_method')-&gt;first()-&gt;entity
$order-&gt;get('payment_gateway')-&gt;first()-&gt;entity


Example of when we get the payment method label for the order receipt email.

if (!$order-&gt;get('payment_method')-&gt;isEmpty()) {
  $variables['payment_method'] = [
    '#markup' =&gt; $order-&gt;get('payment_method')-&gt;first()-&gt;entity-&gt;label(),
  ];
}


From https://github.com/drupalcommerce/commerce/blob/77b25bf4889a940eed6652475c3952c36144efc0/modules/payment/commerce_payment.module#L122