I have need to get Payment information in checkout_submit_all_after event observer.

File path: magento/app/code/Vendor/Module/etc/events/xml

<event name="checkout_submit_all_after">
    <observer name="order_create_all_after" instance="Vendor\Module\Observer\OrderObserver" />

File path: magento/app/code/Vendor/Module/Observer/OrderObserver.php

class OrderObserver implements \Magento\Framework\Event\ObserverInterface
    public function execute(\Magento\Framework\Event\Observer $observer)
        $event = $observer->getEvent();
        $order = $event->getOrder();

I have try to print order object through the getdata but not get payment information.

Any help will appreciate. Thanks.

  • Have you tried with checkout_onepage_controller_success_action event ? – Pawan Jan 7 at 17:10
  • @Pawan thanks I will try with checkout_onepage_controller_success_action event – Kirti Nariya Jan 7 at 17:23
  • Sure, let me know if worked. – Pawan Jan 7 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.