diff --git a/Observer/SendWebhook.php b/Observer/SendWebhook.php index 94f9e84..df56001 100644 --- a/Observer/SendWebhook.php +++ b/Observer/SendWebhook.php @@ -40,8 +40,14 @@ public function execute(\Magento\Framework\Event\Observer $observer) $orderData['increment_id'] = $order->getIncrementId(); $orderData['picqer_magento_key'] = $magentoKey; - $this->_curl->addHeader("Content-Type", "application/json"); - $this->_curl->setTimeout(2); // in seconds + $this->_curl->setHeaders([ + 'Content-Type' => 'application/json' + ]); + + $this->_curl->setOptions([ + CURLOPT_TIMEOUT => 2 // in seconds + ]); + try { $this->_curl->post(sprintf('https://%s.picqer.com/webshops/magento2/orderPush/%s', trim($subDomain), trim($magentoKey)), json_encode($orderData)); } catch (\Exception $e) { diff --git a/composer.json b/composer.json index 8491269..1070e77 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "picqer/magento2-plugin", "description": "Picqer Extended Integration for Magento 2", - "version": "1.0.2", + "version": "1.0.3", "type": "magento2-module", "keywords": [ "picqer", diff --git a/etc/module.xml b/etc/module.xml index 42f4e5d..296850c 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,6 +1,6 @@ - +