I'm trying to do some different processing after an order is placed depending on which payment method a customer uses.
In my EventSubscriber, I have the following code:
public static function getSubscribedEvents() {
$events = [
'commerce_order.place.post_transition' => 'onPlaceTransition'
];
return $events;
}
public function onPlaceTransition(WorkflowTransitionEvent $event) {
$order = $event->getEntity();
Now I want to get the name or id of the payment method that was used from the order, but when I used kint($order)
I couldn't find a way to access the payment method.
How do I access the payment method given an $order
object?