Skip to content

Commit

Permalink
Merge pull request #6 from picqer/fix/overide-all-headers-and-options
Browse files Browse the repository at this point in the history
Fix: Headers en opties van een vorige request worden gebruikt.
  • Loading branch information
sanderlissenburg authored May 3, 2022
2 parents b8fa468 + 25c2ae1 commit 02332b0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions Observer/SendWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Picqer_Integration" setup_version="1.0.2">
<module name="Picqer_Integration" setup_version="1.0.3">
<sequence>
<module name="Magento_Webapi" />
</sequence>
Expand Down

0 comments on commit 02332b0

Please sign in to comment.