Skip to content
Snippets Groups Projects
Commit a092e7cc authored by Christel Loftus's avatar Christel Loftus
Browse files

add check for empty webhook key

parent ce4c61da
No related branches found
No related tags found
1 merge request!201.0.41
Pipeline #69042 passed
......@@ -1066,6 +1066,11 @@ class BobGo extends AbstractCarrierOnline implements \Magento\Shipping\Model\Car
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
// Check if the webhook key is empty and return false
if (empty($webhookKey)) {
return false;
}
// Convert the string to a boolean value
$isEnabled = $this->isWebhookEnabled();
......
......@@ -52,6 +52,11 @@ abstract class OrderWebhookBase implements ObserverInterface
// Generate the signature using the webhook key saved in config
$webhookKey = $this->scopeConfig->getValue('carriers/bobgo/webhook_key', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
// Check if the webhook key is empty and return false
if (empty($webhookKey)) {
return;
}
// Send the webhook
$this->bobGo->encodeWebhookAndPostRequest($url, $data, $storeId, $webhookKey);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment