Skip to content
Snippets Groups Projects
Select Git revision
  • 716ecb04b0759c92c01b801f33af34182209e837
  • dev default protected
  • prod protected
  • 1.0.58
  • 1.0.57
  • 1.0.52
  • 1.0.56
  • 1.0.51
  • 1.0.50
  • 1.0.33
  • 1.0.32
  • 1.0.31
  • 1.0.30
  • 1.0.29
  • 1.0.28
  • 1.0.27
  • 1.0.26
  • 1.0.25
  • 1.0.24
  • 1.0.23
  • 1.0.22
  • 1.0.21
  • 1.0.20
23 results

OrderUpdateWebhook.php

Blame
  • OrderUpdateWebhook.php 959 B
    <?php
    
    namespace BobGroup\BobGo\Observer;
    
    use Magento\Framework\Event\Observer;
    use Magento\Framework\Event\ObserverInterface;
    use Magento\Framework\HTTP\Client\Curl;
    use BobGroup\BobGo\Model\Carrier\UData;
    use Psr\Log\LoggerInterface;
    use Magento\Store\Model\StoreManagerInterface;
    
    class OrderUpdateWebhook extends OrderWebhookBase
    {
        protected Curl $curl;
        protected LoggerInterface $logger;
        protected StoreManagerInterface $storeManager;
    
        public function __construct(LoggerInterface $logger, Curl $curl, StoreManagerInterface $storeManager)
        {
            $this->logger = $logger;
            $this->curl = $curl;
            $this->storeManager = $storeManager;
        }
    
        public function execute(Observer $observer)
        {
            $order = $observer->getEvent()->getOrder();
            if (!$order) {
                return;
            }
    
            // Extract order data and send to the webhook URL
            $this->sendWebhook($order, 'order_updated');
        }
    }