public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $order = $observer->getEvent()->getOrder();

        //verify pagseguro transaction
        if ($order->getStatus() == 'pagseguro_iniciado') {
            $orderId = $order->getId();
            $environment = $this->_scopeConfig->getValue('payment/pagseguro/environment');
            
            //save order in pagseguro_orders table
            $this->saveOrderAndEnvironment($orderId, $environment);

            //$this->getEnvironmentName($environment);
            $this->updateSalesOrderGridEnvironment($orderId, $environment);
        }

        return $this;
    }
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $order = $observer->getEvent()->getOrder();

        //verify pagseguro transaction
        if ($order->getStatus() == 'pagseguro_iniciado') {
            $orderId = $order->getId();
            $environment = $this->_scopeConfig->getValue('payment/pagseguro/environment');
            
            //save order in pagseguro_orders table
            $this->saveOrderAndEnvironment($orderId, $environment);

            //$this->getEnvironmentName($environment);
            $this->updateSalesOrderGridEnvironment($orderId, $environment);
        }

        return $this;
    }
public function execute ( \ Magento \ Framework \ Event \ Observer $ observer ) { $ order = $ observer -> getEvent ( ) -> getOrder ( ) ; //verify pagseguro transaction if ( $ order -> getStatus ( ) == 'pagseguro_iniciado' ) { $ orderId = $ order -> getId ( ) ; $ environment = $ this -> _scopeConfig -> getValue ( 'payment/pagseguro/environment' ) ; //save order in pagseguro_orders table $ this -> saveOrderAndEnvironment ( $ orderId , $ environment ) ; //$this->getEnvironmentName($environment); $ this -> updateSalesOrderGridEnvironment ( $ orderId , $ environment ) ; } return $ this ; }
checkout_submit_all_after event handler to store pagseguro order info

@param \Magento\Framework\Event\Observer $observer
@return void
checkout_submit_all_after event handler to store pagseguro order info