Skip to content

Commit

Permalink
Merge pull request #17 from getkevin/feature/fix-webhooks-refund
Browse files Browse the repository at this point in the history
Feature/fix webhooks refund
  • Loading branch information
KubaJM authored Jul 13, 2022
2 parents 7d96c53 + 827261d commit 2302521
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Controller/Payment/Notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Model/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
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": "getkevin/kevin-magento2",
"description": "Implements integration with the Kevin payment service provider.",
"version": "1.3.1",
"version": "1.3.2",
"authors": [
{
"name": "kevin.",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2302521

Please sign in to comment.