diff --git a/Controller/Payment/Notify.php b/Controller/Payment/Notify.php index 607e17c..62bc05a 100644 --- a/Controller/Payment/Notify.php +++ b/Controller/Payment/Notify.php @@ -139,7 +139,13 @@ public function execute() $order->getStoreId() ); $headers = getallheaders(); + $webhookUrl = $this->getRequest()->getUriString(); + + if (getenv('CUSTOM_WEBHOOK_URL')) { + $webhookUrl = getenv('CUSTOM_WEBHOOK_URL').'kevin/payment/notify'; + } + $isValid = $this->api->verifySignature($signature, $body, $headers, $webhookUrl); if ($isValid) { // emulate environment to get specific store config data diff --git a/Model/Adapter.php b/Model/Adapter.php index d72e6d5..8bba528 100644 --- a/Model/Adapter.php +++ b/Model/Adapter.php @@ -143,7 +143,7 @@ public function initRefund($transactionId, $amount) { $params = [ 'amount' => $amount, - 'Webhook-URL' => $this->storeManager->getStore()->getBaseUrl().'kevin/payment/notify', + 'Webhook-URL' => $this->getWebHookContextUrl('kevin/payment/notify'), ]; $response = $this->api->initRefund($transactionId, $params); diff --git a/composer.json b/composer.json index 3468229..1386294 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "getkevin/kevin-magento2", "description": "Implements integration with the Kevin payment service provider.", - "version": "1.3.1", + "version": "1.3.2", "authors": [ { "name": "kevin.", diff --git a/composer.lock b/composer.lock index 540fe3f..214e9a0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a1680d97da75cb1e210e641daa0b3af0", + "content-hash": "281ac8b284d0c6f11c3853ab8bb7553a", "packages": [ { "name": "getkevin/kevin-php",