Skip to content

Commit

Permalink
[PT-1105] fix SettingChangedSubscriber triggering on other module set…
Browse files Browse the repository at this point in the history
…tings change (#14)
  • Loading branch information
tikohov20 authored Mar 5, 2024
1 parent f38bcbf commit 2732491
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Event/SettingChangedSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public function __construct(MonduClient $client)

public function afterSettingChange(SettingChangedEvent $event)
{
if($event->getModuleId() !== 'oemondu') return;

if (
$event->getSettingName() === 'oemonduWebhookSecret' ||
$event->getSettingName() === 'oemonduIsMerchantIdentified'
Expand Down Expand Up @@ -53,6 +55,8 @@ protected function registerWebhooks()
$webhookParams = oxNew(Webhook::class, $webhookTopic)->getData();
$response = $this->_client->registerWebhook($webhookParams);

if ($response['status'] === 409) return;

if (!$response['webhook']) {
$errorMessage = $response['status'] === 403 ? 'INVALID_API_KEY' : 'MONDU_REGISTER_WEBHOOK_ERROR';

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mondu/bnpl-checkout-oxid",
"description": "Mondu payment method for the OXID eShop.",
"type": "oxideshop-module",
"version": "1.1.0",
"version": "1.1.1",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
2 changes: 1 addition & 1 deletion metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'en' => 'Module for Mondu payment.',
),
'thumbnail' => 'out/src/images/logo.png',
'version' => '1.1.0',
'version' => '1.1.1',
'author' => 'Mondu GmbH',
'url' => 'https://www.mondu.ai',
'email' => '[email protected]',
Expand Down

0 comments on commit 2732491

Please sign in to comment.